8000 GitHub - Dotcommando/nest-based-api
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Dotcommando/nest-based-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Nest Logo

Description

Nest based example of API.

Ports in use: 9000, 9001, 27037.

Microservice gateway contains only ts code. It works on 9000 port, so check if the port is not in use on your machine.

Microservice users contains Mongo DB in docker image and ts code which works on 9001 port. Mongo DB especially runs on 27037 instead of standard 27017 port. This is to avoid conflict with your current project with Mongo in case you have one.

Installation

In each microservice (gateway and users folders) rename .env.example to .env. To run gateway:

# gateway
$ cd gateway
$ npm install
$ npm run start:dev

To run users:

# users
$ cd users
$ npm install
$ npm run start:dev
$ npm run db:up

Running Mongo DB in docker for users microservice

# up image with mongo DB
$ npm run db:up

# stop image
$ npm run db:stop

# fully remove image
$ npm run db:stop

How to test endpoints from Postman

In Postman: File -> Import... and choose file nest_basics.postman_collection.json. At first run request Create User. Copy from response field data.user._id and paste it into Params _id of request Get User by Id. Then run request Get User by Id.

License

The boilerplate is MIT licensed.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
0