mirror of
https://github.com/outline/outline.git
synced 2026-12-01 17:32:49 +03:00
Add test logging around startup times
This commit is contained in:
1 parent
9ef4e2b437
commit
e4b42ff5ae
2 files changed
+22
No files matched your search
@@ -21,6 +21,8 @@ import updates from "./utils/updates";
|
||||
|
||||
const app = new Koa();
|
||||
|
||||
console.log("Before compress middleware");
|
||||
|
||||
app.use(compress());
|
||||
|
||||
if (process.env.NODE_ENV === "development") {
|
||||
@@ -91,6 +93,8 @@ if (process.env.NODE_ENV === "development") {
|
||||
// catch errors in one place, automatically set status and response headers
|
||||
onerror(app);
|
||||
|
||||
console.log("Before Sentry middleware");
|
||||
|
||||
if (process.env.SENTRY_DSN) {
|
||||
Sentry.init({
|
||||
dsn: process.env.SENTRY_DSN,
|
||||
@@ -129,9 +133,16 @@ app.on("error", (error, ctx) => {
|
||||
}
|
||||
});
|
||||
|
||||
console.log("Before mounting auth routes");
|
||||
|
||||
app.use(mount("/auth", auth));
|
||||
|
||||
console.log("Before mounting api routes");
|
||||
|
||||
app.use(mount("/api", api));
|
||||
|
||||
console.log("Before mounting CSP middlewares");
|
||||
|
||||
app.use(helmet());
|
||||
app.use(
|
||||
contentSecurityPolicy({
|
||||
@@ -160,8 +171,13 @@ app.use(
|
||||
);
|
||||
app.use(dnsPrefetchControl({ allow: true }));
|
||||
app.use(referrerPolicy({ policy: "no-referrer" }));
|
||||
|
||||
console.log("Before mounting routes");
|
||||
|
||||
app.use(mount(routes));
|
||||
|
||||
console.log("Before updates check");
|
||||
|
||||
/**
|
||||
* Production updates and anonymous analytics.
|
||||
*
|
||||
|
||||
@@ -9,9 +9,13 @@ import policy from "./policies";
|
||||
import { client, subscriber } from "./redis";
|
||||
import { getUserForJWT } from "./utils/jwt";
|
||||
|
||||
console.log("before createServer");
|
||||
|
||||
const server = http.createServer(app.callback());
|
||||
let io;
|
||||
|
||||
console.log("before IO");
|
||||
|
||||
const { can } = policy;
|
||||
|
||||
io = IO(server, {
|
||||
@@ -182,6 +186,8 @@ server.on("listening", () => {
|
||||
console.log(`\n> Listening on http://localhost:${address.port}\n`);
|
||||
});
|
||||
|
||||
console.log("Before server.listen");
|
||||
|
||||
server.listen(process.env.PORT || "3000");
|
||||
|
||||
export const socketio = io;
|
||||
|
||||
Reference in new issue
Block a user