My first project ever made, it's a REST API created using technologies such as JavaScript with Express framework and PSQL as a database.
The API has different HTTP requests (GET, POST, DELETE, PATCH) to access to data using any program.
-Node.js v23.6.2
-PostgreSQL 14.11
To correctly connect to the provided database and run this project, it is required to create two separate files.
Follow the instructions below:
-
Clone the repository:
git clone https://github.com/dasartini/project-NC-News.git
-
Navigate to the project directory:
cd project-NC-News
-
In the root folder create a file named ".env.developement" connecting the PGDATABASE to the develpoment database in setup.sql, just paste this text in this variable.
PGDATABASE=nc_news
-
In the root folder create a file named ".env.test" connecting the PGDATABASE to the test database in setup.sql, just paste this text in this variable.
PGDATABASE=nc_news_test
-
Install dependencies:
npm install
-
Set up the database:
npm run setup-dbs
-
Seed the database:
npm run seed
-
To run the tests locally, run:
npm run test
This will run the test suite and provide all the results.
NOTE 1: This project was developed using Node.j v23.6.2 and PostgreSQL 14.11 therefore this would be a minimum but is not a requirement.
To run this project in your browser I invite you to open this link:
----> https://project-nc-news-adrian-sartini.onrender.com/api
NOTE 2: It might take one minute to completely load due to the free service where the project is hosted.
You can navigate between the different methods I implemented in the app.js file.
Just type the endpoint at the end of the link, you can find all the endpoints in the endpoints.json file in the root folder.
https://project-nc-news-adrian-sartini.onrender.com/api/articles/6