Skip to content

librity/new_gobarber_backend

Repository files navigation

GoBarber 2.0 Back End

Database Setup

Create a persistent postgres docker container.

  1. Check whether any processes are using postgres' default port:
$ lsof -i :5432
  1. Create the container:

The first port number is the port we will interface with through our machine, and the second is the port that postgres will expose inside the container.

- If your're outside this postgres container and you wish to interface with it, you should use the first port number

- If you spawn a shell inside the postgres container and you wish to interface with postgres, you should use the second port number.

For the most part, there's no reason to change the second port number.

$ docker run --name postgres -e POSTGRES_PASSWORD=postgres -p 5432:5432 -d -t postgres
  1. check container's logs:
$ docker logs postgres
  1. Access postgres and create the appropriate user and databases.

App Setup

  1. Create and configure a dotenv file:
$ cp .env.example .env
  1. Install dependencies, run migrations and deploy the dev server:
$ yarn install && yarn typeorm migration:run && yarn dev:server

Run Tests

$ yarn test

About

Rocket Seat - New Bootcamp - GoBarber 2.0 Back End

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published