feat: added dev and prod setup using esbuild

This commit is contained in:
Akhil Mohan
2024-01-27 12:38:22 +05:30
parent 356e981401
commit 2243bcb3a4
7 changed files with 1721 additions and 0 deletions
+22
View File
@@ -0,0 +1,22 @@
import Fasitfy from "fastify";
const fastify = Fasitfy({
logger: true,
});
// Declare a route
fastify.get("/", async function handler(_request, _reply) {
return { hello: "world changed" };
});
// Run the server!
const main = async () => {
try {
await fastify.listen({ port: 8000 });
} catch (err) {
fastify.log.error(err);
process.exit(1);
}
};
main();