Nest framework TypeScript starter repository.
- postman
- npm v6.12.1
- pgadmin4
- postgresql 11
- Clone the repository
$ git clone https://github.com/FrankRivas/NestNewsApiv2
- Install dependencies
$ npm install
-
Restore the database backup
-
Configure .env file on the root directory of the project
-
Configure ormconfig.json file on the root directory of the project
NYT_URL_BASE=https://api.nytimes.com/svc/search/v2/articlesearch.json?
NYT_URL_FILTERS=&sort=newest&fl=_id, pub_date, snippet, web_url, byline, headline
NYT_KEY=[Your secret nyt key API]
GUARDIAN_URL_BASE=https://content.guardianapis.com/search?
GUARDIAN_URL_FILTERS=&order-by=newest&show-fields=byline&show-tags=contributors
GUARDIAN_KEY=[Your secret guardian key API]
GUARDIAN_URL_BASE=https://newsapi.org/v2/everything?
GUARDIAN_URL_FILTERS=&pageSize=10
GUARDIAN_KEY=[Your secret newsapi key]
SECRET_CODE_JWT=[Your secret token]
{ "type": "postgres", "host": "localhost", "port": 5432, "username": [Your username], "password": [Your password], "database": [Your database name], "entities": ["dist/**/*.entity{.ts,.js}"], "synchronize": true }
psql [DB name] < database/backup
# development
$ npm run start
# watch mode
$ npm run start:dev
# production mode
$ npm run start:prod
# unit tests
$ npm run test
# e2e tests
$ npm run test:e2e
# test coverage
$ npm run test:cov
In order to generate a token, you can use users from the database or create a new user
https://documenter.getpostman.com/view/3221284/SWLb8UW3
- Author - Francisco Rivas