ng serve -o
cd api
docker-compose build
docker-compose up
Create a document:
http://localhost:4000/student/add Method: POST
Body example:
{ "student_name": "Arturito", "student_id_number": 1265, "courses": { "ingles": 4, "matematicas": 4.5, "literatura": 5 }, "semester": 1, "active": true }
the Student Schema is defined as:
{ student_name: { type: String, required: true }, student_id_number: { type: Number, required: true }, courses: { type: JSON }, semester: { type: Number }, active: { type: Boolean, required: true } }
Get the collection: http://localhost:4000/student/
Method: GET
Returns all documents from the Student collection.
Get a document:
http://localhost:4000/student/get/:id
Method: GET
(The parameter id corresponds to the student_id_number field of a student in the database)
Update/modify a Document: http://localhost:4000/student/update/:id Method: POST. (The parameter id corresponds to the id of the student in the database)
Delete a Document: http://localhost:4000/student/delete/:id Method: GET (The parameter id corresponds to the id of the student in the database)
Update all documents that match a criteria: http://localhost:4000/student/semester Method: POST Updates all documents from the Student collection incrementing the semester where the student is active
Get the collection: http://localhost:4000/student/mean/:course Method: GET (The mean will be get from all students in the course parameter) Returns the mean of all students in a course from the Student collection.
convert an arabic number to roman http://localhost:4200/roman/numerals
This project was generated with Angular CLI version 8.3.3.
Run ng serve
for a dev server. Navigate to http://localhost:4200/
.
Advantages of using containers:
- Containers are light (unlike virtual machines)
- Portable
- Easy to reuse
- Each container is independent
- Fast Release
- Provides an eficient usage of resources
Many things, like a Data Base, a OS, a program can be containerized. We connect to a host (kernel of the OS) instead of connecting to the OS itself.
It is important to use Containers because they have several advantages (like mentioned above) compared to other tools like virtual machines, so it can improve performance in building projects.
Maintenability and deployment, for example, can be enhanced by using containers, as they are also small, and easy to manage.