Skip to content

Log what port is listened on and for each http request #109

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 15, 2025
Merged
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
5 changes: 5 additions & 0 deletions app/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { verifyKey } from "discord-interactions";
import { createRequestHandler } from "@react-router/express";
import express from "express";
import bodyParser from "body-parser";
import pinoHttp from "pino-http";

import { applicationKey } from "#~/helpers/env.server";

Expand All @@ -16,6 +17,10 @@ import * as track from "#~/commands/track";
import setupTicket from "#~/commands/setupTickets";

export const app = express();

const logger = pinoHttp();
app.use(logger);

app.use(
createRequestHandler({
// @ts-expect-error - virtual module provided by React Router at build time
Expand Down
5 changes: 4 additions & 1 deletion index.dev.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,7 @@ viteDevServer
console.log({ error });
});

app.listen(process.env.PORT || "3000", async () => {});
const PORT = process.env.PORT || "3000";
app.listen(PORT, async () => {
console.log("INI", "Now listening on port", PORT);
});
5 changes: 4 additions & 1 deletion index.prod.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,7 @@ const errorHandler = (error) => {
process.on("uncaughtException", errorHandler);
process.on("unhandledRejection", errorHandler);

app.listen(process.env.PORT || "3000", async () => {});
const PORT = process.env.PORT || "3000";
app.listen(PORT, async () => {
console.log("INI", "Now listening on port", PORT);
});
147 changes: 144 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
"kysely-ctl": "^0.10.1",
"lodash-es": "^4.17.21",
"node-cron": "^3.0.0",
"pino-http": "^10.4.0",
"pretty-bytes": "^5.6.0",
"reacord": "^0.6.0",
"react": "^18.2.0",
Expand Down
Loading