Learn how to deploy your ShipThing API separately from the frontend as a dedicated service.
api
directory is independent. If your current api directory is /apps/web/api
, you can copy its code to /apps/api
If you are using the standard next.js api route, you need to refer to hono to migrate to hono. You can find an example in the /apps/api
directory.
Next, add the following files into the apps/api directory:
/api/search
path. This is because the docs search is a serverless function inside our web app and we don’t want to proxy it through the API service.Now you should be able to run the API service locally, by running the known pnpm dev command inside your monorepo. It will start both apps in development mode.To keep the repository clean, you can also remove the /apps/web/app/api/[[...rest]]
folder, as it is no longer needed.apps/api
directory
To make Prisma work in the Docker container, you need to set the engine type to binary in the schema.prisma file: