2023-09-11 11:19:50 +00:00
|
|
|
### Nodejs Javascript vanilla
|
|
|
|
|
|
|
|
# Install dependencies
|
|
|
|
|
|
|
|
`npm install`
|
|
|
|
|
|
|
|
# replace \*.example files to .env
|
|
|
|
|
|
|
|
- ./
|
|
|
|
- infra/
|
|
|
|
|
|
|
|
# Run Mongo container
|
|
|
|
|
|
|
|
`docker compose -f "infra/docker-compose.yaml" up -d --build`
|
|
|
|
|
|
|
|
# Start the server
|
|
|
|
|
|
|
|
`node src/server.js`
|
|
|
|
|
|
|
|
# Routes
|
|
|
|
|
|
|
|
- New User - POST /register Body: `{
|
2023-09-11 11:20:50 +00:00
|
|
|
"name": "Name"
|
2023-09-11 11:19:50 +00:00
|
|
|
"email": "Email@email.com",
|
|
|
|
"password": "Password"
|
|
|
|
}`
|
|
|
|
|
|
|
|
- Login - POST /login Body: `{
|
|
|
|
"email": "Email@email.com",
|
|
|
|
"password": "Password"
|
|
|
|
}`
|
|
|
|
|
|
|
|
- Logout - POST /logout
|
|
|
|
|
|
|
|
- Get User - GET /profile (Need to have a token cookie)
|
|
|
|
|