Merge pull request #126 from calcom/feat/improve-readme-deploy
feat: improve deployment docs for apipull/9078/head
commit
def5c8dd4c
17
README.md
17
README.md
|
@ -178,3 +178,20 @@ We make sure of this by not using next in dev, but next build && next start, if
|
|||
|
||||
See <https://github.com/vercel/next.js/blob/canary/packages/next/server/dev/hot-reloader.ts#L79>. Here in dev mode OPTIONS method is hardcoded to return only GET and OPTIONS as allowed method. Running in Production mode would cause this file to be not used. This is hot-reloading logic only.
|
||||
To remove this limitation, we need to ensure that on local endpoints are requested by swagger at /api/v1 and not /v1
|
||||
|
||||
|
||||
## Deployment
|
||||
|
||||
We recommend deploying API in vercel.
|
||||
|
||||
There's some settings that you'll need to setup.
|
||||
|
||||
Under Vercel > Your API Deployment > Settings
|
||||
|
||||
In General > Build & Development Settings
|
||||
BUILD COMMAND: `yarn turbo run build --scope=@calcom/api --include-dependencies --no-deps`
|
||||
OUTPUT DIRECTORY: `apps/api/.next`
|
||||
|
||||
See `scripts/vercel-deploy.sh` for more info on how the deployment is done.
|
||||
## Environment variables
|
||||
Lastly API requires an env var for `DATABASE_URL`
|
|
@ -38,7 +38,7 @@ export async function deleteHandler(req: NextApiRequest) {
|
|||
if (!isAdmin && query.userId !== req.userId)
|
||||
throw new HttpError({ statusCode: 401, message: "Unauthorized" });
|
||||
|
||||
const user = await prisma.user.findUnique({ where: { id: query.id } });
|
||||
const user = await prisma.user.findUnique({ where: { id: query.userId } });
|
||||
if (!user) throw new HttpError({ statusCode: 404, message: "User not found" });
|
||||
|
||||
await prisma.user.delete({ where: { id: user.id } });
|
||||
|
|
Loading…
Reference in New Issue