diff --git a/src/core/app.ts b/src/core/app.ts new file mode 100644 index 0000000..63f0add --- /dev/null +++ b/src/core/app.ts @@ -0,0 +1,13 @@ +import Fastify from 'fastify' + +export async function buildApp() { + const app = Fastify({ + logger: true + }) + + app.get('/', async () => { + return { status: 'ok' } + }) + + return app +} \ No newline at end of file diff --git a/src/core/server.ts b/src/core/server.ts new file mode 100644 index 0000000..0707114 --- /dev/null +++ b/src/core/server.ts @@ -0,0 +1,15 @@ +import { buildApp } from './app' + +const start = async () => { + const app = await buildApp() + + try { + await app.listen({ port: 1234, host: '0.0.0.0' }) + console.log('Server running on http://localhost:1234') + } catch (err) { + app.log.error(err) + process.exit(1) + } +} + +start() \ No newline at end of file