hiarlyfs / ModClima-backend

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Description

This a backend to the ModClima test.

Used Tecnologies

How to Run

  • First of all install the dependencies. You can type
  yarn install

to install all dependencies.

  • Then you can chose from one of the run mode below.

Start Mode

  • Create a postgres database with postgis and postgis_topology

  • Create the .env file in the root directory

  • Put DATABASE_URL environment variable in the .env file

    • Format of DATABASE_URL: postgres://user':'password'@'host'/'database'
    • Example: DATABASE_URL=postgres://user:123@127.0.0.1/modclima
  • Type in your terminal:

      yarn start
  • Observations:

    • yarn start run with nodejs

Dev mode

  • Create a postgres database with postgis and postgis_topology

  • Create the .env file in the root directory

  • Put DATABASE_URL environment variable in the .env file

    • Format of DATABASE_URL: postgres://user':'password'@'host'/'database'
    • Example: DATABASE_URL=postgres://user:123@127.0.0.1/modclima
  • Type in your terminal:

      yarn dev
  • Observations:

Run tests

  • Create a postgres database with postgis and postgis_topology
  • Create the .env.test file in the root directory
  • Put DB_STRING_CONNECTION environment variable in the .env.test file
    • Format of DATABASE_URL: postgres://'user':'password'@'host'/'database'
    • Example: DATABASE_URL=postgres://user:123@127.0.0.1/modclimatest
  • Type in your terminal
      yarn test

Documentation

To see the documentation run your application in start ou dev mode and access the /api-docs route or access documentation

About


Languages

Language:JavaScript 100.0%