This is the official Typescript service library for Merrymake. It defines all the basic functions needed to work with Merrymake.
Here is the most basic example of how to use this library:
import {
merrymakeService,
MIME_TYPES,
replyToOrigin,
Envelope,
} from "@merrymake/service";
async function handleHello(payloadBuffer: Buffer, envelope: Envelope) {
let payload = payloadBuffer.toString();
replyToOrigin(`Hello, ${payload}!`, { contentType: MIME_TYPES.txt });
}
merrymakeService({
handleHello,
});
For more information check out our tutorials at merrymake.dev.
All templates are available through our CLI and on our GitHub.