#Create the image with node
docker build . -t direcly-node
#Starts the container with the API image on Port 3000
docker run -p 3000:3000 -d direcly-node
#After that the app runs on the port 3000. To check it:
docker ps
By default used Port is 3000
You can visit the app browsing at http://localhost:3000.
The front pages are:
We have 3 endpoints:
GET: '/api/v1/students' #Used to get All students
GET: '/api/v1/students/' #Used to get specific Student by
POST: '/api/v1/students' #Used to create a Student
This App uses 'basic-auth' in a Middlelware, all the pages including the v1 Routes requires a Basic Auth, that is gonna shown as a Promt.
Credentials are:
- user: 'admin'
- password: '1234'
Note: I know Basic Auth is also used is sent in the Headers, but in this case is used to visit the page, but works if it's injected in the route. Was implemented just to show the functionality.
Client: Js
Server: Node, Express
db/ folder was used just as a test. In order to create a non-real database.