RESTful service that powers the newspad_client_v2.
- git clone https://github.com/Collins33/NewsPad_v2_server.git
- cd into the project folder
- run
npm install
- create an account on mongo DB atlas
- create a mongo atlas database
- ensure the IP security settings allow connections from everywhere
- copy the connection url given to you.
- create nodemon.json file
- add the database connection given to you
"MONGO_DATABASE_URL": "database url given"
- run
npm start
- create test database on mongo atlas
- ensure the IP security settings allow connections from everywhere
- save the database url given
"MONGO_DATABASE_TEST_URL":"test database url given"
- run
npm test
Endpoint | FUNCTIONALITY |
---|---|
POST /api/v1/users/signup | This will create the create an accoount |
POST /api/v1/users/login | This will login the user |
POST /api/V1/news | This will save a news article |
GET /api/V1/news | This will retrieve saved news articles |
Payload
{
"email":"name.name@gmail.com",
"password":"123bunnyhop"
}
Response
{
"message": "User was created successfully"
}
Payload
{
"email":"name.name@gmail.com",
"password":"123bunnyhop"
}
Response
{
"message": "Auth successfully",
"token": "xxxxxxxxxxxx",
"email": "name.name@gmail.com"
}
- Make sure to provide a valid token when saving the article
Payload
{
{
"author":"John Doe",
"title":"The virus",
"description":"The john Doe virus",
"url":"www.wwe/instagram/kane/me/true/now/instead/sting/MN/stuff/kinky.com",
"urlToImage":null,
"source":"Nou"
}
}
Response
{
"response":"The article was saved successfully"
}
- NODE/EXPRESS - The web framework used
- npm - Dependency Management
- Mongo Atlas-Database
- COLLINS NJAU MURU
This project is licensed under the MIT License