Back End repo from a project made by Emmanuel Gil, part of the tecnical challenge for a Full Stack Developer position.
In the app you can post new comments and read the comments already posted from the database. The comments can be deleted or edited as well.
-
Open an SQL terminal and type your credentials.
-
Create the database with the command:
- Connect with the densitydb database with the command:
- Create the table with the command:
CREATE TABLE stack(
id SERIAL PRIMARY KEY,
email VARCHAR(255) UNIQUE,
comment VARCHAR(255)
);
- In the API folder create a .env file and complete the variables with the credentials you already use to start the SQL terminal. In the DB_DATABASE type densitydb. Here's an example:
DB_USER = yourUser
DB_PASSWORD = yourPassword
DB_HOST = localhost
DB_PORT = 5432
DB_DATABASE = densitydb
- Install all the dependencies needed to run the project with:
- Run the app with:
- You can check the API at http://localhost:4000/allcomments