Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/williamkoller/api-sales
API Sales
https://github.com/williamkoller/api-sales
api cors docker express http typeorm typescript
Last synced: about 2 months ago
JSON representation
API Sales
- Host: GitHub
- URL: https://github.com/williamkoller/api-sales
- Owner: williamkoller
- License: mit
- Created: 2021-01-27T14:33:05.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2022-03-11T02:10:34.000Z (almost 3 years ago)
- Last Synced: 2023-03-03T21:09:31.132Z (almost 2 years ago)
- Topics: api, cors, docker, express, http, typeorm, typescript
- Language: TypeScript
- Homepage:
- Size: 273 KB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# API de Vendas
- Etapas para setup
- `yarn install --frozen-lockfile`
- `cp -r env.example .env````
# Database
POSTGRES_HOST=
POSTGRES_USER=
POSTGRES_PASSWORD=
POSTGRES_DATABASE=
POSTGRES_PORT=# Application
PORT=300
JWT_SECRET=
JWT_EXPIRES_IN=
```- criar arquivo `ormconfig.json`
```
{
"type": "postgres",
"host": "localhost",
"port": 5432,
"username": "root",
"password": "root",
"database": "db_api_sales",
"logging": false,
"sincronazed": true,
"entities": ["./src/modules/**/typeorm/entities/*.ts"],
"migrations": ["./src/shared/typeorm/migrations/*.ts"],
"cli": {
"migrationsDir": "./src/shared/typeorm/migrations"
}
```- rodar docker `docker-compose up -d && yarn dev`
- rodar migrations `yarn typeorm migration:run`- Postman
- Como pegar token automaticamente
- Ir no tab de tests do postman```
var res = pm.response.json();
pm.environment.set('token', res.token);
```