Express
Express is a popular web server library used in many web applications.
Instructions
Gather the required information
These are the parameters you'll need
- a build command
- which should build the application prior to packaging for deployment
- common examples include:
npm run build(recommended),tsc, andvite. - if no build command is required, use
echo "build not required"
- a start command
- which tells airbase how to start your web application
- common examples include:
node dist/index.js(if built fromsrc/index.ts, use the appropriate path to the entrypoint)node index.js(if no build is required or directly shipping js code)
- a list of dependencies to include
- dependencies are automatically traced to reduce the packaged deployment size (50 MB limit)
- additional assets can be manually included by adding globs to the
includesection of airbase.json - some examples of globs:
public/**/*,static/**/*.json(more available here
Configure Airbase to use the express framework
Run airbase configure and select express from the list of frameworks when prompted.
user@laptop example % airbase configure
Configuring project for Airbase
? Project Name: example
? Framework: express
? Command to build production deployment: npm run build
? Command to start production server: node dist/index.js
{
name: "example"
framework: "nuxtjs"
scripts: {
build: "npm run build"
start: "node dist/index.js"
}
}
? Save configuration? Yes
Configuration saved in ./airbase.json
Run airbase build to create a deployment package.
user@laptop example %Build and deploy your application
Now that the Airbase configuration has been updated, run airbase build as normal to build your application.
Then deploy the application with airbase deploy.