/api-presale

API Presales

Primary LanguageJavaScript

api-presale

a Sails v1 application

TODO API

CRUD created with framework Sailsjs http server, including a router.

Database

Connection to Mongodb

Install packages

npm i

Execute server with nodemon

npm run dev

The command was included in the package.json

Migration was configured by default in alter to prevent sails from asking every time the development server is reloaded.

migrate: 'alter'

  ...
  "scripts": {
    "start": "NODE_ENV=production node app.js",
    "dev": "nodemon --watch ./api/ --watch ./config/ app.js",
    "test": "npm run lint && npm run custom-tests && echo 'Done.'",
    "lint": "./node_modules/eslint/bin/eslint.js . --max-warnings=0 --report-unused-disable-directives && echo '✔  Your .js files look good.'",
    "custom-tests": "echo \"(No other custom tests yet.)\" && echo"
  },
  ...

API

[POST]:

Create presale.
URL: /api/v1/create

[PUT]:

Update presale.
Param path: id unique presale.
URL: /api/v1/update/:id

[DELETE]:

Delete presale.
Param path: id unique presale.
URL: /api/v1/delete/:id'

[GET]:

Get all items of presales.
URL: /api/v1/presales

[GET]:

Gets a single item by its id.
Param path: id unique presale.
URL: /api/v1/presale/:id

Links

Version info

This app was originally generated on Mon Aug 31 2020 18:47:23 GMT-0500 (Central Daylight Time) using Sails v1.2.5.