Project Overview
Test project to implement an HTTP Notification System.
Built With
Running the project
- Clone the repo.
- Make sure you have node and MySQL installed
- Install NPM packages
npm install
- Configure your environment. Run the command below to make an env file
npm run env:copy
- Update the env file with the config as stated
- Run database migrations
npm run migrate
- Run the command below to start the project from the project root
./start-server.sh or npm start
Running Tests
Kindly create a database name pangaea_test
Run Test: npm run test
Run test coverage: npm run test:coverage
What has been covered.
The API service implements 3 endpoints:
NOTE: all endpoints are POST requests.
Subscribe
The subscribe's endpoint allows you to create a subscriber to a particular topic:
http://localhost:8000/subscribe/topic1
sample data: {url:"http://localhost:9000/test3"}
Publish
The publish endpoint allows you to publish messages to subscribers of a topic:
http://localhost:8000/publish/topic1
sample data: {name:"Alan Ross", "score":100}
Resend
The resend endpoint allows you to resend pending messages:
http://localhost:8000/resend