Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions ts/uptime/frontend/frontend.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
import { appMeta } from "encore.dev";
import { api } from "encore.dev/api";
import next from "next";

const meta = appMeta();

const dev = meta.environment.cloud === "local";

const app = next({
dev: true,
dev,
dir: "./frontend",
});

const handle = app.getRequestHandler();
const prepared = app.prepare();

Expand All @@ -13,5 +19,5 @@ export const nextjs = api.raw(
async (req, resp) => {
await prepared; // Wait for Next.js to start up.
return handle(req, resp);
},
}
);
1 change: 1 addition & 0 deletions ts/uptime/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"license": "MPL-2.0",
"type": "module",
"scripts": {
"build": "next build ./frontend",
"test": "vitest",
"gen": "encore gen client --output=./frontend/app/lib/client.ts --env=local"
},
Expand Down