chore: fastify + ts api setup

This commit is contained in:
karishmas6
2024-04-04 08:58:17 +05:30
parent 5c07c54b57
commit 2e6a0290f2
7 changed files with 23 additions and 2 deletions

20
api/src/index.ts Normal file
View File

@@ -0,0 +1,20 @@
import Fastify from 'fastify'
const fastify = Fastify();
fastify.get('/', async (request, reply) => {
return 'Hello there! 👋';
})
const start = async () => {
try {
await fastify.listen({ port: 8000 });
console.log('Server listening on port 8000');
} catch (err) {
console.error(err);
process.exit(1);
}
}
start();