This is a back-end server built with Node.js, Express.js, and MongoDB for managing coins. It provides endpoints for user registration and authentication, as well as for adding, editing, and deleting coins.
- Clone the repository by running
git clone https://github.com/papayyg/coins-api.git
. - Navigate to the project directory with
cd coins-api
. - Install dependencies by running
npm install
. - Start the server by running
npm start
. - The API documentation is available at
/api-docs
.
POST /api/auth/register
: Register a new user.POST /api/auth/login
: Log in a user.
GET /api/coin
: Get a list of all coins.POST /api/coin
: Add a new coin.GET /api/coin/:id
: Get data about a coin by its ID.PUT /api/coin/:id
: Edit data about a coin by its ID.DELETE /api/coin/:id
: Delete a coin by its ID.
For more detailed information about each endpoint, refer to the API documentation.
The API documentation is available at /api-docs
, where you can find descriptions of each endpoint, test requests, and view data structures.
Create a .env
file and specify the following variables:
databaseURL
: URL for the database connection.secretKey
: Secret key for JWT token generation.PORT
: Port number for the server (default: 3000).
You can run the project in development mode using npm run dev
.
This server can also be easily installed and launched to use for frontend learning purposes.
Aslan Mammadrzayev - aslan.mamedrzaev@gmail.com