/places-backend

Backend for the project "Mesto"

Primary LanguageJavaScript

Places server

version : 1.0.0

Public test server

https://www.oshusha.ru/ or 84.201.130.20

How to develop the server

Initialize the environment

1. Clone the repository:

git clone https://github.com/oshusha/places-backend.git
cd places-backend

2. Install the dependencies:

npm install

Launch the server

1. Run the development server

In development mode with hot reload:

npm run dev

In production mode:

npm run start

2. Open localhost:3000 to see the live server.

By default, this server runs on port 3000. To change the default port the nodejs server instance is listening on, simply use the .env file:

ex: DATABASE_URL=mongodb://127.0.0.1:27017/places

PORT=3000

DEMO

API methods:

GET /cards — get all cards

GET /cards/:cardId - get card by id

POST /cards — create cards

DELETE /cards/:cardId — delete card by id

PATCH /cards/:cardId/likes- like the card

DELETE /cards/:cardId/likes -remove like

GET /users - get all users

GET /users/:userId - get user by id

POST /signin - create user

POST /signup - log in as user

PATCH /users/me - update user info

PATCH /users/me/avatar - update avatar