feat(lst): intial scafolding for the new system
This commit is contained in:
14
apps/ocme/index.ts
Normal file
14
apps/ocme/index.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
import app from "./src/app";
|
||||
const port = process.env.OCME_PORT || 5001; //bun will automatically grab this as well.
|
||||
Bun.serve({
|
||||
port,
|
||||
fetch: app.fetch,
|
||||
hostname: "0.0.0.0",
|
||||
});
|
||||
|
||||
await Bun.build({
|
||||
entrypoints: ["./index.js"],
|
||||
outdir: "../../dist/ocme",
|
||||
});
|
||||
|
||||
console.log(`ocme is running on port ${port}`);
|
||||
13
apps/ocme/package.json
Normal file
13
apps/ocme/package.json
Normal file
@@ -0,0 +1,13 @@
|
||||
{
|
||||
"name": "lstv2-ocme",
|
||||
"version": "1.0.0",
|
||||
"description": "",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "bun --watch index.ts",
|
||||
"build": "bun build ./index.ts"
|
||||
},
|
||||
"devDependencies": {
|
||||
"typescript": "^5.7.3"
|
||||
}
|
||||
}
|
||||
27
apps/ocme/src/app.ts
Normal file
27
apps/ocme/src/app.ts
Normal file
@@ -0,0 +1,27 @@
|
||||
import { funnyFunction } from "@shared/lib";
|
||||
import { Hono } from "hono";
|
||||
import { serveStatic } from "hono/bun";
|
||||
import { logger } from "hono/logger";
|
||||
//import { expensesRoute } from "./routes/expenses";
|
||||
|
||||
const app = new Hono();
|
||||
|
||||
app.use("*", logger());
|
||||
|
||||
// running the hi function
|
||||
funnyFunction();
|
||||
app.get("/", (c) => {
|
||||
return c.json({ success: true, message: "hello from bun on the ocmeserver" });
|
||||
});
|
||||
|
||||
app.get("/api", (c) => {
|
||||
return c.json({ success: true, message: "first api for ocme" });
|
||||
});
|
||||
//const apiRoute = app.basePath("/api").route("/expenses", expensesRoute);
|
||||
|
||||
app.get("*", serveStatic({ root: "./frontend/dist" }));
|
||||
app.get("*", serveStatic({ path: "./frontend/dist/index.html" }));
|
||||
|
||||
export default app;
|
||||
|
||||
//export type ApiRoute = typeof apiRoute;
|
||||
7
apps/ocme/tsconfig.json
Normal file
7
apps/ocme/tsconfig.json
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"extends": "../../tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "dist"
|
||||
},
|
||||
"include": ["src", "index.ts"]
|
||||
}
|
||||
Reference in New Issue
Block a user