First implementation of RapiPOX Server
- Project startup
- Typescript
- Linters
- Relay connection
- Http request
- Get actions from files
- Dockerfile
- Umbrelize
- Whitelist protection
- Tests
Set proper nvm version
nvm use
Install dependencies
pnpm i
Copy .env.example to .env
cp .env.example .env
Edit .env file with proper values
pnpm dev
Just publish a nostr event to the same relay server that the RapiPOX server is connected to.
{
"id": "GENERATED_REQUEST_EVENT_ID",
"kind": 20001,
"content": "{\"url\": \"https://lawallet.ar/.well-known/lnurlp/pos\"}",
"tags": [
"p": "RAPIPOX_SERVER_PUBLIC_KEY",
"action": "http",
],
...
}
The action
tag should contain a valid action, in this case we are using http
that takes JSON content and uses the Fetch API to make a request to the given URL.
The server will respond publishing a nostr event with the same id
and kind
but with the content
containing the response from the request.
{
...
"kind": 20001,
"content": "{\"status\": 200, \"body\": \"<html>...</html>\"}",
"tags": [
"p": "YOUR_PUBLIC_KEY",
"e": "GENERATED_REQUEST_EVENT_ID",
],
...
}