Running an Abyss application
** Note: Abyss App Starter-Kit Only **
Local development
To run an Abyss application locally, use the following command:
npm run devThis command starts the local development server an run all three products in the starter app:
webruns onlocalhost:3000apiruns onlocalhost:4000workshop(Parcels) runs onlocalhost:5000
To run each product separately, you can use the following commands:
- For the
webproduct:npm run web - For the
apiproduct:npm run api - For the
workshopproduct:npm run workshop
Note: The npm run dev command should not be used to run the application in production. It is intended for local development only and includes features like hot module replacement, which are not suitable for production environments.
Web
Production build
To build the Abyss web application for production, use the following command in the products/web directory:
npm run buildThis command compiles the application into an optimized build that can be deployed to a production environment. To learn more about the possible configuration options for the production build, see our Abyss configuration docs.
The build can be run locally using the following command in the products/web directory:
npm run previewThis runs the production build locally on the same port as listed above.
Please note that any of our web commands do not automatically accept Next CLI options. While we use Next for our build, the arguments that gets passed down (like --port, for example) are then specifically extracted for our own commands. Teams are welcome to create their own scripts that leverage Next CLI options if they wish to do so.
Running in production
How you run the Abyss application in production depends on the application's build type. By default, Abyss applications are built as Next.js applications ("buildType": "browser-node"), which can be run by executing the build/server.js file. For example:
node server.jsThis command starts the Next.js server, which serves the application in production mode. Ensure that you have set the environment variables and configurations required for production before running this command.
When using "buildType": "browser-static", the application is built as a static site. In this case, there will be a version for each environment in the build/ directory. You can serve the index.html file however you'd like.
Running in different environments
To run the Abyss application in different environments, set the APP_ENV environment variable. For example: APP_ENV="test". This can be injected into your build process or set in your hosting environment and allows for the correct use of our config tool based on the current environment.
API
Production build
To build the Abyss API application for production, use the following command in the products/api directory:
npm run buildThis command compiles the API application into an optimized build that can be deployed to a production environment.
Running in production
To run the Abyss API application in production, execute the build/server.js file. For example:
node server.jsWorkshop (Parcels)
To learn more about Abyss Parcels, see our Parcels documentation.