This project is a small edge-computing service for the implementation of web sockets with ease.
The service exposes a HTTP route that allows the integration with the event source monitored by the web socket. See the contract for it below:
POST {{host}}/events
Authorization: Bearer {{token}}
{
"event": "My event name",
"data": {
"message": "my custom data"
}
}
This application uses nitro to utilise an agonistic approach, allowing this project to run either on the edge or on Node.js or any other JavaScript/TypeScript platform. If you want to get to know further about nitro, take a look and learn from their official quick start guide.
To start the development environment, you must fulfill the following prerequirements:
a. install the dependencies with pnpm
pnpm install
b. create .env file
cp .env.example .env
c. run the development server
pnpm run dev
If you'd like to use a HTTP client to test the service, we encourage you to take
a look at Yaak. If you choose to use it, you can import
the Yaak schema into your workspace by selecting e2e/yaak.yaak.json
.