chore: Adds initial code.
This commit is contained in:
parent
a4ea6406e6
commit
939eb0b9d7
8 changed files with 1282 additions and 17 deletions
23
src/index.ts
23
src/index.ts
|
@ -1 +1,22 @@
|
|||
console.log("Hello, world!");
|
||||
import process from "node:process";
|
||||
|
||||
import { PrismaClient } from '@prisma/client';
|
||||
import Fastify from "fastify";
|
||||
|
||||
const prisma = new PrismaClient();
|
||||
|
||||
const fastify = Fastify({
|
||||
logger: true
|
||||
});
|
||||
|
||||
fastify.get('/', async function handler (request, reply) {
|
||||
return { hello: 'world' };
|
||||
})
|
||||
|
||||
// Run the server!
|
||||
try {
|
||||
await fastify.listen({ port: 3000 });
|
||||
} catch (err) {
|
||||
fastify.log.error(err);
|
||||
process.exit(1);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue