-
Install Node.js and npm
-
Install PostgreSQL Database
-
Install Postman Client REST
- Clone this repository
git clone https://github.com/isaquielfernandes/node-rest-api.git
npm install
in the project root folder on local- TypeORM(ormconfig.json)
// database config
{
"type": "postgres",
"host": "localhost",
"port": 5432,
"username": "your db username",
"password": "your db passaword",
"database": "weatherdb",
"synchronize": true,
"logging": false,
"entities": [
"src/entity/**/*.ts"
],
"migrations": [
"src/migration/**/*.ts"
],
"subscribers": [
"src/subscriber/**/*.ts"
]
}
npm run dev
to start- Browse to http://localhost:3000
npm run build
to build to production locally
GET /forecast/
GET /forecast/:city
- Para pesquisar previsao de tempo por name de cidade