generated from nhcarrigan/template
This commit is contained in:
+13
-10
@@ -70,7 +70,7 @@ export const instantiateServer = (amari: Amari): void => {
|
||||
});
|
||||
|
||||
server.post<{
|
||||
// eslint-disable-next-line @typescript-eslint/naming-convention -- Fastify standard.
|
||||
// eslint-disable-next-line @typescript-eslint/naming-convention -- Fastify standard.
|
||||
Body: GithubPayload;
|
||||
// eslint-disable-next-line @typescript-eslint/naming-convention -- Fastify standard.
|
||||
Querystring: { secret: string };
|
||||
@@ -87,16 +87,19 @@ export const instantiateServer = (amari: Amari): void => {
|
||||
|
||||
server.
|
||||
// eslint-disable-next-line @typescript-eslint/naming-convention -- Fastify standard.
|
||||
post<{ Body: FormSubmission }>("/form", async(request, response) => {
|
||||
try {
|
||||
await processFormSubmission(amari, request, response);
|
||||
} catch (error) {
|
||||
if (!(error instanceof Error)) {
|
||||
return;
|
||||
post<{ Body: Array<FormSubmission>; Querystring: { form: string } }>(
|
||||
"/form",
|
||||
async(request, response) => {
|
||||
try {
|
||||
await processFormSubmission(amari, request, response);
|
||||
} catch (error) {
|
||||
if (!(error instanceof Error)) {
|
||||
return;
|
||||
}
|
||||
await logger.error("/form route", error);
|
||||
}
|
||||
await logger.error("/form route", error);
|
||||
}
|
||||
});
|
||||
},
|
||||
);
|
||||
|
||||
server.listen({ port: 7044 }, (error) => {
|
||||
if (error) {
|
||||
|
||||
Reference in New Issue
Block a user