ApiRest_Electronic_Devices_ExpressJS
Rest Api about electronic devices implemented with Express, Morgan, Railway ,NodeJS, Sequelize, Jest Testing, dotenv, cors, express-validator, nodemon, swagger, swagger-ui, PostgreSQL, ohers.
View
Section 1) Description, configuration and technologies
Section 2) Endpoints and Examples
Section 3) Functionality Testing and References
Section 1) Description, configuration and technologies
View
1.0.0) General Description
1.0.1) Description Architecture and Operation
View
Once a work environment has been created through some IDE, we clone the project
git clone https://github.com/andresWeitzel/ApiRest_Dispositivos_Electronicos_ExpressJS
We position ourselves on the project
We install the latest LTS version of Nodejs(v18) .
We install all the necessary libraries
The environment variables used in the project are maintained to simplify their configuration process. It is recommended to add the corresponding file (.env) to the .gitignore.
The following script configured in the project's package.json is responsible for
Raise the server with express (productive environment)
Raise the server with express and nodemon (local dev environment)
"scripts": {
"dev": "nodemon src/server.js",
"start": "node src/server.js"
},
* We run the app from a terminal for a local environment.
```git
npm run dev
We run the app from a terminal for a productive environment.
If a message appears indicating that port 8080 is already in use, we can terminate all dependent processes and run the app again
npx kill-port 8080
npm run dev or npm start
1.2) Project configuration from scratch 🔝
View
Once a work environment has been created through some IDE, we clone the project
git clone https://github.com/andresWeitzel/ApiRest_Dispositivos_Electronicos_ExpressJS
We position ourselves on the project
We install the latest LTS version of Nodejs(v18)
We open a terminal from vsc
We initialize a nodejs project
We create a .gitignore file and add the necessary files (for the moment node_modules)
We create a direct source (src) to add all the logic of our app
We install the sequelize plugin
We install the plugins for postgreSQL
npm i swagger-ui-express swagger-jsdoc
The environment variables used in the project are maintained to simplify their configuration process. It is recommended to add the corresponding file (.env) to the .gitignore.
The following script configured in the project's package.json is responsible for
Raise the server with express (productive environment)
Raise the server with express and nodemon (local dev environment)
"scripts": {
"dev": "nodemon src/server.js",
"start": "node src/server.js"
},
* We run the app from a terminal for a local environment.
```git
npm run dev
We run the app from a terminal for a productive environment.
If a message appears indicating that port 8080 is already in use, we can terminate all dependent processes and run the app again
npx kill-port 8080
npm run dev or npm start
View
Technologies
Version
Purpose
SDK
4.3.2
Automatic Module Injection for Lambdas
NodeJS
14.18.1
JS Library
VSC
1.72.2
IDE
Postman
10.11
Http Client
CMD
10
Command Prompt for command line
Git
2.29.1
Version Control
Extension
Prettier - Code formatter
YAML - Autoformatter .yml (alt+shift+f)
Section 2) Endpoints and Examples.
2.0) Endpoints and resources 🔝
View
Section 3) Functionality Testing and References.
3.0) Functionality test 🔝
View
View
Sequelize with PostgreSQL
Remark-lint