generated from nhcarrigan/template
This commit is contained in:
@@ -5,7 +5,9 @@
|
||||
*/
|
||||
|
||||
import fastify from "fastify";
|
||||
import { processGithubEvent } from "../modules/processGitHubEvent.js";
|
||||
import { logger } from "../utils/logger.js";
|
||||
import type { GithubPayload } from "../interfaces/github.js";
|
||||
|
||||
const html = `<!DOCTYPE html>
|
||||
<html>
|
||||
@@ -62,6 +64,12 @@ export const instantiateServer = (): void => {
|
||||
response.send(html);
|
||||
});
|
||||
|
||||
server.
|
||||
// eslint-disable-next-line @typescript-eslint/naming-convention -- Fastify standard.
|
||||
post<{ Body: GithubPayload }>("/github", async(request, response) => {
|
||||
await processGithubEvent(request, response);
|
||||
});
|
||||
|
||||
server.listen({ port: 7044 }, (error) => {
|
||||
if (error) {
|
||||
void logger.error("instantiate server", error);
|
||||
|
||||
Reference in New Issue
Block a user