Deploying with Docker issues
I'm tryint to deploy the back-end with Docker on an Ubuntu box. I have the front end up via Apache, and the backend is reporting 404 on routes like /api/auth/me and /api/email/signup. I added a test route and I am able to hit it with curl via both localhost and the fully qualified DNS url - so that much is working.
I went in and hacked the .wasp/build/server/src/server.ts to print the list of routes, and, it's pretty much empty.
--------------------
ADDED THIS TO server.ts
function printRoutes(app: Express) {
console.log('Registered routes:');
app._router.stack.forEach((middleware) => {
if (middleware.route) {
// routes registered directly on the app
console.log(
} else if (middleware.name === 'router') {
// router middleware
middleware.handle.stack.forEach((handler) => {
if (handler.route) {
console.log(
}
});
}
});
}
// Call this function just before server.listen()
printRoutes(app);
---------------------------
SERVER LOG AT STARTUP:
stripeMiddlewareFn is called
Starting pg-boss...
pg-boss started!
Registered routes:
get /^/?(?=/|$)/i / <------- AFAIK SHOULD BE ROUTES HERE
Server listening on port 3001
This suggests that the wasp build has failed to produce any. Trying this solution on dev, it does not appear that this code path is hit so I'm not able to see routes. Suggestions?
I went in and hacked the .wasp/build/server/src/server.ts to print the list of routes, and, it's pretty much empty.
--------------------
ADDED THIS TO server.ts
function printRoutes(app: Express) {
console.log('Registered routes:');
app._router.stack.forEach((middleware) => {
if (middleware.route) {
// routes registered directly on the app
console.log(
${Object.keys(middleware.route.methods)} ${middleware.route.path});} else if (middleware.name === 'router') {
// router middleware
middleware.handle.stack.forEach((handler) => {
if (handler.route) {
console.log(
${Object.keys(handler.route.methods)} ${middleware.regexp} ${handler.route.path});}
});
}
});
}
// Call this function just before server.listen()
printRoutes(app);
---------------------------
SERVER LOG AT STARTUP:
stripeMiddlewareFn is called
Starting pg-boss...
pg-boss started!
Registered routes:
get /^/?(?=/|$)/i / <------- AFAIK SHOULD BE ROUTES HERE
Server listening on port 3001
This suggests that the wasp build has failed to produce any. Trying this solution on dev, it does not appear that this code path is hit so I'm not able to see routes. Suggestions?