nestjs
Unanswered
Ivory Gull posted this in #help-forum
Ivory GullOP
Hey guys,
I am trying to deploy a nx monorepo with a nestjs backend and a react frontend.
this is my vercel.json:
these are my scripts in my package.json:
I do serve my react app as static module like this:
The setup builds properly but I see the vercel 404 screen when visiting the deployment url.
Does somebody have any experience with this?
I am trying to deploy a nx monorepo with a nestjs backend and a react frontend.
this is my vercel.json:
{
"version": 2,
"builds": [
{
"src": "dist/apps/backend/main.js",
"use": "@vercel/node"
}
],
"routes": [
{
"src": "/(.*)",
"dest": "dist/apps/backend/main.js",
"methods": ["GET", "POST", "PUT", "PATCH", "DELETE", "HEAD", "OPTIONS"]
}
]
}these are my scripts in my package.json:
"scripts": {
"backend": "nx serve backend",
"landing-page": "nx serve landing-page",
"start:prod": "node dist/apps/backend/main.js",
"build": "nx run-many --target=build --projects=backend,landing-page, --parallel=true",
"dev": "nx run-many --target=serve --all=true",
"gen:theme-typings": "chakra-cli tokens apps/landing-page/src/theme.ts",
"postinstall": "npm run gen:theme-typings"
},I do serve my react app as static module like this:
ServeStaticModule.forRoot({
rootPath: join(__dirname, '..', 'landing-page'),
exclude: ['/api/(.*)'],
}),The setup builds properly but I see the vercel 404 screen when visiting the deployment url.
Does somebody have any experience with this?
2 Replies
Ivory GullOP
@Ivory Gull Hey guys,
I am trying to deploy a nx monorepo with a nestjs backend and a react frontend.
this is my vercel.json:
js
{
"version": 2,
"builds": [
{
"src": "dist/apps/backend/main.js",
"use": "@vercel/node"
}
],
"routes": [
{
"src": "/(.*)",
"dest": "dist/apps/backend/main.js",
"methods": ["GET", "POST", "PUT", "PATCH", "DELETE", "HEAD", "OPTIONS"]
}
]
}
these are my scripts in my package.json:
js
"scripts": {
"backend": "nx serve backend",
"landing-page": "nx serve landing-page",
"start:prod": "node dist/apps/backend/main.js",
"build": "nx run-many --target=build --projects=backend,landing-page, --parallel=true",
"dev": "nx run-many --target=serve --all=true",
"gen:theme-typings": "chakra-cli tokens apps/landing-page/src/theme.ts",
"postinstall": "npm run gen:theme-typings"
},
I do serve my react app as static module like this:
js
ServeStaticModule.forRoot({
rootPath: join(__dirname, '..', 'landing-page'),
exclude: ['/api/(.*)'],
}),
The setup builds properly but I see the vercel 404 screen when visiting the deployment url.
Does somebody have any experience with this?
this server is about nextjs not nestjs, i suggest you go to the nestjs server (if it exists) and/or vercel discussions https://github.com/orgs/vercel/discussions for this