WaspW
Wasp17mo ago
Sam79

Why doesn't console.log output anything to terminal?

I am trying to debug cors middleware setup. In main.wasp I have:
  server: {
    setupFn: import setup from "@src/ServerSetup",
    middlewareConfigFn: import { serverMiddlewareFn } from "@src/ServerSetup"
  }


In ServerSetup.ts for testing I have:

export const serverMiddlewareFn: MiddlewareConfigFn = (middlewareConfig) => {
  console.log("nothing is shown in the console log")
  middlewareConfig.set('cors', cors({ origin: [config.frontendUrl] }))
  return middlewareConfig
}

Since I see no output it looks like serverMiddlewareFn is never called.
Was this page helpful?