feat: complete TASK-WP0-01 toolchain skeleton
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"name": "@dada/api",
|
||||
"version": "0.0.0",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"build": "tsc -p tsconfig.json",
|
||||
"start": "node dist/main.js",
|
||||
"typecheck": "tsc --noEmit -p tsconfig.json"
|
||||
},
|
||||
"dependencies": {
|
||||
"@fastify/swagger": "9.8.1",
|
||||
"@sinclair/typebox": "0.34.52",
|
||||
"better-sqlite3": "13.0.1",
|
||||
"drizzle-orm": "0.45.2",
|
||||
"fastify": "5.10.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/better-sqlite3": "7.6.13",
|
||||
"@types/node": "24.13.3",
|
||||
"typescript": "7.0.2"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
import swagger from "@fastify/swagger";
|
||||
import Fastify from "fastify";
|
||||
|
||||
export function createApp() {
|
||||
const app = Fastify({ logger: false });
|
||||
|
||||
void app.register(swagger, {
|
||||
openapi: {
|
||||
info: {
|
||||
title: "Dada P0-A",
|
||||
version: "0.0.0",
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
return app;
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
import { createApp } from "./app.js";
|
||||
|
||||
const app = createApp();
|
||||
|
||||
await app.listen({
|
||||
host: "127.0.0.1",
|
||||
port: 43121,
|
||||
});
|
||||
@@ -0,0 +1,12 @@
|
||||
{
|
||||
"extends": "../../tsconfig.base.json",
|
||||
"compilerOptions": {
|
||||
"module": "NodeNext",
|
||||
"moduleResolution": "NodeNext",
|
||||
"lib": ["ES2024"],
|
||||
"types": ["node"],
|
||||
"outDir": "dist",
|
||||
"rootDir": "src"
|
||||
},
|
||||
"include": ["src"]
|
||||
}
|
||||
Reference in New Issue
Block a user