- Clone the repository:
git clone https://github.com/rifqiyusrilmuslikhin/forumapi.git cd forumapi npm install - Configure the application:
- Rename the
.env.examplefile to.env. - Open the
.envfile and update the configuration settings as required.
- Run database migrations:
npm run migrate up
- Create configuration for database testing migrations:
- Create folder config/database
- Create file test.json in config/database
- Fill the
test.jsonfile. Here is an example of the content of thetest.jsonfile:{ "host": "localhost", "port": 5432, "username": "testuser", "password": "testpass", "database": "testdb" }
- Run database testing migrations:
npm run migrate:test up
- Run testing application:
npm run test:watch
- Start the application:
npm run start:dev | npm run start