Skip to content

Latest commit

 

History

History
61 lines (50 loc) · 1.3 KB

Migration_v.0.x_to_v1.x.md

File metadata and controls

61 lines (50 loc) · 1.3 KB

Migration for version 0.x to 1.x.

Table of contents

Simply change the routes variable to the routes.tb.

Api_config for 0.x

const api_config = {
  //...
  routes: [
    {      
      table: 'animals', //<-- YOUR_TABLE_NAME
      event: 'ANIMAL', //<-- YOUR_EVENT_NAME 
      methods: ['GET', 'POST', 'PUT', 'DELETE'], //<-- YOUR_METHODS
      //Used only by methods 'POST' and 'PUT'
      columns: [
          {name: 'id', primary: true},
          {name: 'name'}
      ]
    }
  ]
}

Api_config for 1.x

const api_config = {
  //...
  routes: {
    tb: [
      {      
        table: 'animals', //<-- YOUR_TABLE_NAME
        event: 'ANIMAL', //<-- YOUR_EVENT_NAME 
        methods: ['GET', 'POST', 'PUT', 'DELETE'], //<-- YOUR_METHODS
        //Used only by methods 'POST' and 'PUT'
        columns: [
            {name: 'id', primary: true},
            {name: 'name'}
        ]
      }
    ]
  } 
}

Author

@victor-valencia.

License

Licensed under the MIT license.