Copy .env.example
into .env
and set your own config
npm install
npm run setup
Installs dependencies, runs build
to generate Babel's compilation, runs initDB
to setup DB and runs npm start
to start development
npm run initDB
Drops Adverts DB and loads placeholder data from initialAdverts.json
npm start
/api/adverts
Returns all the adverts
/api/adverts/?someFilters
Returns a filtered list. Admits filter by fields, sorting, skipping and limit reuslts. E.g:
/api/adverts/?select=name price -_id&name=Bicicleta&sort=-name price
/api/register
Returns a JWT needed to access all other API routes
/api/adverts
Create a new advert
/api/thumbnail
Returns an URL with the 100x100 thumbnail of the given image
/api/adverts/id
Updates the match ID element
/api/adverts/id
Deletes the match ID element