This is a RESTful API for managing news articles and topics. It provides CRUD endpoints for news and topic entities, with the ability to associate multiple topics with a news article. Each news article can have a status of 'draft', 'deleted', or 'published', and the GET endpoint allows for filtering by status and topic.
- Node.js
- Express.js
- TypeScript
- Sequelize (ORM)
- my sql / PostgreSQL (or your preferred database)
- Node.js and npm installed on your machine
- mysql / PostgreSQL database configured (update the connection details in
config/config.json
)
- Clone the repository:
bash
git clone https://github.com/rivalditri/A-REST-API-for-News-and-Topic-Management.git
-
Install the dependencies:
bash
npm install -
Set up the database: Create a new mysql / PostgreSQL database Update the database connection details in config/config.json
-
Run the migrations to create the necessary tables:
bash
npx sequelize-cli db:migrate
-
Start the server:
bash
npm run start-dev -
The API will be accessible at http://localhost:3000
For detailed request and response examples, please refer to the API documentation.