Code Challenge Week 4 "Cursos de Visual Thinking API".
-
Creating a endpoint to consult all students information.
-
Creating a endpoint to consult all student's emails with
haveCertificationcertification. -
Creting a endpoint to consult all students with
creditsgreater than 500.
- Go Code Challenge repository.
- Click code
- Copy the URL: SSH or HTTP
- Go your terminal and run command
git clone <URL>
- Done. We clone my repository.
This proyect need dependencies Jest, Express, EsLint and Supertest.
- Run:
npm installto create node_modules files.
If don´t install it, run:
- Jest:
npm install --save-dev jest - Express:
npm install express --save - Eslint:
npm install eslint --save-dev to install dependence andnpm init @eslint/config` to configure the rules. - Supertest:
npm install supertest --save-dev
- Jest: Testing Framework to test my code.
Version 27.5.1 - Express: Web framework to creating API´s and http methods.
Version 4.18.1 - Supertest: Used it to run testing with a http method server.
Version 6.2.3 - Eslint: Used it to find and fix syntax errors and standirse code.
Version 8.15.0
graph TD;
Reader-->studentController
studentService-->studentController
studentController-->server
I separated responsibilities:
- Service: gives functionality to projects: get all students, get all emails and get all students with credits greater than 500.
- Reader: gives auxiliary class to read JSON files.
- Controller: is a connection with the server.
- Run
npm run serverin command line. - The server should be ready, enter endpoints in your browser and will see the API.
- Run tests
npm test
EsLint help us to find and finx syntax error and gives a style guide about standirse code. Here use Airbnb JavaScript Style Guide Version 15.0.0
- Run
npm run linterto find syntax errors. - Run
npm run linter --fixto fix all syntax errors automatically.









