generated from nhcarrigan/template
feat: set up announcement and cors logic for server
This commit is contained in:
23
server/src/routes/base.ts
Normal file
23
server/src/routes/base.ts
Normal file
@ -0,0 +1,23 @@
|
||||
/**
|
||||
* @copyright nhcarrigan
|
||||
* @license Naomi's Public License
|
||||
* @author Naomi Carrigan
|
||||
*/
|
||||
|
||||
import type { FastifyPluginAsync } from "fastify";
|
||||
|
||||
/**
|
||||
* Mounts the entry routes for the application. These routes
|
||||
* should not require CORS, as they are used by external services
|
||||
* such as our uptime monitor.
|
||||
* @param server - The Fastify server instance.
|
||||
*/
|
||||
export const baseRoutes: FastifyPluginAsync = async(server) => {
|
||||
server.get("/", async(_request, reply) => {
|
||||
return await reply.redirect("https://hikari.nhcarrigan.com");
|
||||
});
|
||||
|
||||
server.get("/health", async(_request, reply) => {
|
||||
return await reply.status(200).send("OK~!");
|
||||
});
|
||||
};
|
Reference in New Issue
Block a user