Directory
src
┣ controllers
┃ ┗ news.controller.js
┣ jobs
┃ ┣ fetchPosts.js
┃ ┣ index.js
┃ ┗ scheduler.js
┣ middleware
┃ ┗ validate.routes.middleware.js
┣ models
┃ ┗ news.model.js
┣ routes
┃ ┗ news.routes.js
┣ schema
┃ ┗ news.schema.js
┣ services
┃ ┗ news.service.js
┣ utils
┃ ┣ db.connect.utils.js
┃ ┗ start-server.utils.js
┗ app.js
GET
gets all stories categorised bynew
top
andbest
stories.- A scheduled job
POST
, that sync the published news to a DB every 5 minutes categorized by story typestop
,new
, andbest
. - user
POST
, lets users post's their own story articles. - Allows filtering by the type of item(types/category).
- Paginated requests of 10 items per requests.
http://localhost:1435/api/v1/news/article
1. node.js
2. express
3. mongoose
clone the repo and yarn install
to install the project dependencies and then
yarn start
to start the app in development
yarn dev
to start the app in production
The server needs environment variable for db connection string and port number.
Emeka Okoli twitter