First let’s get the backend from Github and get it installed:
# clone application into directory git clone git@github.com:RestlessDev/todos_application_backend.git todos_backend # enter the directory cd todos_backend # npm install npm install # copy the .env template cp .env.template .env
A this point you’ll need to go to your PostgreSQL tool of choice; we recommend the PGAdmin.
You’ll need to complete the following steps:
- Create a new database. We call ours
todos. - Create a new user with all the permissions on that new database. We call ours
todos_user. Choose a good password for this user. - Run the script located in
<projectroot>/sql/todos.sqlto create the tables.
Now you’ll need to update the .env file you just created with your new database parameters.
# database RESTPGORM_DB_HOST=<your host name> RESTPGORM_DB_PORT=5432 RESTPGORM_DB_USERNAME=<your user name> RESTPGORM_DB_PASSWORD=<your password> RESTPGORM_DB_NAME=<your database name>
If this has all worked successfully, you should be able to launch the server with the following command:
# start server npm run start
The server will be running at port 8022 by default.