gRPC protobuf api for the integration of IPWHOIS.IO services implemented with Nodejs, Expressjs, Jest, Testing, others.
See
- 1.0) Project Description.
- 1.1) Project Execution.
- 1.2) Project setup from scratch
- 1.3) Technologies.
1.0) Description 🔝
1.1) Project Execution 🔝
See
- Once a work environment has been created through some IDE, we clone the project
git clone https://github.com/andresWeitzel/gRPC_Netflix_CRUD_Nodejs
- We position ourselves on the project
cd 'projectName'
- We install the latest LTS version of Nodejs(v18).
- We install all the necessary libraries
npm i
- 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.
npm run dev
- We run the app from a terminal for a productive environment.
npm start
- 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 🔝
See
- Once a work environment has been created through some IDE, we clone the project
git clone https://github.com/andresWeitzel/gRPC_Netflix_CRUD_Nodejs
- We position ourselves on the project
cd 'projectName'
- We install the latest LTS version of Nodejs(v18)
- We open a terminal from vsc
- We initialize a nodejs project
npm init -y
- We create a .gitignore file and add the necessary files (for the moment node_modules)
node_modules
- We create a direct source (src) to add all the logic of our app
- We install the plugin for express (framework)
npm i express
- We install the plugin for cors (resource management)
npm i cors
- We install the plugin for dotenv (environment variables)
npm i dotenv
- We install the plugin for morgan-middleware (errors, formats, etc)
npm i morgan
We install uuid for unique ids
npm i uuid
- We install the plugin for nodemon (autoreload server) globally
npm i -g nodemon
- We install the plugin for nodemon (autoreload server) for development
npm i nodemon --save-dev
- We install the libraries for the gRPC compiler
npm i @grpc/proto-loader
- 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.
npm run dev
- We run the app from a terminal for a productive environment.
npm start
- 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.3) Tecnologías 🔝
Ver
| Tecnologías | Versión | Finalidad |
| ------------- | ------------- | ------------- |
| SDK | 4.3.2 | Inyección Automática de Módulos para Lambdas |
| NodeJS | 14.18.1 | Librería JS |
| VSC | 1.72.2 | IDE |
| Postman | 10.11 | Cliente Http |
| CMD | 10 | Símbolo del Sistema para linea de comandos |
| Git | 2.29.1 | Control de Versiones |
| Plugin | Descripción |
| ------------- | ------------- |
| Serverless Plugin | Librerías para la Definición Modular |
| Extensión |
| ------------- |
| Prettier - Code formatter |
| YAML - Autoformatter .yml (alt+shift+f) |