The 2 Euro Collection is an API REST built with Node.js and Express.js that connects to a MongoDB database. The API contains information about coins and users, allowing CRUD operations to be performed on coins and user authentication with JWT.
-
Get all coins
- GET /coins
- Returns an array with all coins in the database.
-
Get one coin
- GET /coins/:id
- Returns a specific coin based on the ID passed in the URL parameter.
-
Create a coin
- POST /coins/create
- Creates a new coin with the information provided in the request body.
-
Delete a coin
- DELETE /coins/delete/:id
- Deletes a specific coin based on the ID passed in the URL parameter.
- Login user
- POST /users/login
- Authenticates a user by comparing the email and password provided in the request body with the information stored in the database. If the authentication is successful, returns a JWT token that can be used for future requests that require authentication.
Run npm install to install dependencies. Create a .env file based on the .env.example file and set the necessary environment variables. Run npm start to start the server.
Clone the repository and install all the needed dependencies. npm install
To run the build use npm run build
To start the server use npm start
To run the testing suites use npm test
This is a full stack project, you can find the frontend code here
Production: Go to The2Euro