https://news-api-project.onrender.com/api
This api is intended to provide a way to interact with a store of components that one would expect on a news site such as articles and comments.
- Retrieving comments by article and articles by id
- Comments are linked to articles and can be posted to any existing article
- Articles and comments are linked to existing users
- Managing user content such as being able to delete comments
- Voting system on comments
If you wish run to this project locally, fork this repo and then clone to your local machine using:
$ git clone <url-of-your-for-repo>
Make sure to install the project dependencies local by:
$ npm install
If you are using npm or:
$ yarn install
If you are using yarn.
To set up the local databases you can use the setup-dbs script provided. By default this will created databases with the names nc_news and nc_news_test. To change this, change the names of the databases provided in ./db/setup.sql.
Before you can seed the development and test databases, you will need to set two .env files in the main directory. One called .env.test with the following content:
PGDATABASE=<name-of-your-test-database>
.env.development should contain the following:
PGDATABASE=<name-of-your-development-database>
By default, the test database is nc_news_test while the development database is nc_news.
You can any current tests or tests that you have implemented using the predefined test script.
- Node version >= 16.0.0
- PostgreSQL version >= 14.6