Russian 👈
This is a service for creating and storing ads. The service provides APIs working in JSON format.
- MongoDB
- Express
- Node.js
$ npm install
In the config.json file, specify the MongoDB port and token.
To start the server:
$ node app.js
or
$ npm run start
Main page - /
- Accepts fields: name, description, several links to photos, price.
- Returns the ID of the created ad and the result code (error or success)
Get all ads - /api/ads
Sort by price - /api/ads?price=desc
or /api/ads?price=asc
Sort by creation date - /api/ads?date=desc
or /api/ads?date=asc
Ad name, price, link to the main photo - /api/:id
Optional fields (can be requested by passing the 'fields' parameter): description, links to all photos - /api/fields/:id