Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gmartins-dev/api-node-mongodb
making a api with node and mongodb
https://github.com/gmartins-dev/api-node-mongodb
Last synced: 28 days ago
JSON representation
making a api with node and mongodb
- Host: GitHub
- URL: https://github.com/gmartins-dev/api-node-mongodb
- Owner: gmartins-dev
- Created: 2022-04-29T19:50:30.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-04-30T20:12:50.000Z (over 2 years ago)
- Last Synced: 2024-10-16T18:50:24.584Z (3 months ago)
- Language: JavaScript
- Homepage:
- Size: 50.8 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
#CRUD - API padrão RESTful
Express --> tratamento de requisições e enviar respostas aos endpoints
-MongoDB --> ODM Mongoose
-MongoDB Atlas --> cloud service deploy
-Nodemon --> real time app on dev ambient
-Postman -> for API requisions and responses tests
-Dotenv -> security, using local variables to not export sensitive application data
=========================================
Iniciando o projeto:
npm init -y
npm install express nodemon mongoose
git init
git branch -M main
git push origin main
"scripts": {
"start": "nodemon ./index.js localhost 3000"
}create index.js and import dependencies
const express = require('express')
const app = express()
const mongoose = require('mongoose')#database acess:
.env local variables
#POSSIVEIS MELHORIAS:
-converter o ID enviado pelo db para algo mais "legivel"