https://github.com/iamnotstatic/pangaea-backend-test
https://github.com/iamnotstatic/pangaea-backend-test
Last synced: about 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/iamnotstatic/pangaea-backend-test
- Owner: iamnotstatic
- Created: 2021-01-10T10:52:19.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2021-01-12T01:19:23.000Z (over 5 years ago)
- Last Synced: 2025-02-06T10:53:16.891Z (over 1 year ago)
- Language: JavaScript
- Size: 154 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Pangaea Backend Takehome
This API uses `POST` request to communicate and HTTP [response codes](https://en.wikipedia.org/wiki/List_of_HTTP_status_codes) to indenticate status and errors. All responses come in standard JSON. All requests must be valid JSON.
## Packages Used
Redis https://www.npmjs.com/package/redis
Express https://www.npmjs.com/package/express
Axios https://www.npmjs.com/package/axios
## How to run the servers
### Windows OS
```
./start-server.sh
```
### Mac OS
```
sh start-server.sh
```
## Publish a topic
Run the below command on your terminal
```terminal
curl -X POST -H "Content-Type: application/json" -d '{"message": "hello"}' http://localhost:8000/publish/topic1
```
## Subscribe to a topic
Run the below command on your terminal
```terminal
curl -X POST -H "Content-Type: application/json" -d '{ "url": "http://localhost:9000/test1"}' http://localhost:8000/subscribe/topic1
```