Welcome to My News API, a RESTful API built using Node.js, PostgreSQL, and Express to be used as the backend service for an interactive news site such as Reddit or DIGG. The API enables fetching of articles, topics, comments and users with additional queries for some endpoints, and has a full relational database seeded with test and development data.
Check out the hosted version on Render here
- Node.js v23.1.0
- PostgreSQL v16.4
- Express v4.21.1
- Jest v27.5.1 (with Jest-Extended and Jest-Sorted packages)
- Supertest v7.0.0
- Husky v8.0.2
- Supabase
- Render
Access the hosted version on Render: https://my-news-2.onrender.com/api/
Use the endpoint reference below (/api
returns a full list of endpoints and request info)
Or, follow the steps below to set up a local repo.
$ npm install
$ npm run setup-dbs
$ npm run seed
Files must be in the root directory of the project, with PGDATABASE=<your_dev_db_name>
and PGDATABASE=<your_test_db_name>
in the respective files.
$ npm run test
Features CRUD operations for Articles, Topics, Comments and Users.
GET /api
GET /api/articles
?sort_by (created_at (default), title, author, body, votes, article_img_url)
?order (desc (default), asc)
?topic (filter by topic)
GET /api/articles/:article_id
GET /api/articles/:article_id/comments
POST /api/articles/:article_id/comments
PATCH /api/articles/:article_id
GET /api/topics
DELETE /api/comments/:comment_id
GET /api/users
This portfolio project was created as part of a Digital Skills Bootcamp in Software Engineering provided by Northcoders