Newer
Older
FORESTIER Fabien
committed
# Legacy AUTH middleware
FORESTIER Fabien
committed
This middleware has been developed with the [NestJS](https://nestjs.com/) framework. It requires [Node.js](https://nodejs.org/en/) in order to run.
Once Node.js installed on your computer, you will need to install the project's dependencies. Go to the root of the project and run the following command.
FORESTIER Fabien
committed
npm install
FORESTIER Fabien
committed
## Environment variables
In order to run the code, some environment variables are needed. They are specified in the `template.env` file at the root of the project.
For a local deployment:
1. `cp template.env .env`
2. Edit .env according to the chosen configuration
FORESTIER Fabien
committed
The values will be read from the file by default when running with docker. If you run the service outside of docker you can export those variables.
FORESTIER Fabien
committed
## Running the app without docker
You will need to provide a healthy connection to a database in order for the service to start.
```bash
# development
FORESTIER Fabien
committed
npm run start
FORESTIER Fabien
committed
npm run start:dev
# production mode
FORESTIER Fabien
committed
npm run start:prod
FORESTIER Fabien
committed
## Running the app with docker
```bash
# build
FORESTIER Fabien
committed
docker-compose build
FORESTIER Fabien
committed
# deploy
FORESTIER Fabien
committed
docker-compose up [-d]
FORESTIER Fabien
committed
# build and deploy
FORESTIER Fabien
committed
docker-compose up --build [-d]
FORESTIER Fabien
committed
```
<!-- ## Test
```bash
# unit tests
$ npm run test
# e2e tests
$ npm run test:e2e
# test coverage
$ npm run test:cov