Run a Next App

If this is your first Space app take a look at the getting started guide.

If you don’t have an existing Next app already you can create a new one by following the offical Next instructions.

For Space to be able to run Next it needs to be configured to ouput a standalone app. This ensures that the app is built to be served by a NodeJS server, refer to the Next Docs for more information.

Please modify next.config.js to set the output to standalone:

/** @type {import('next').NextConfig} */
const nextConfig = {
    output: "standalone",
}

module.exports = nextConfig

Once you’ve edited your next.config.js file, just modify your Spacefile file before pushing changes to Space.

Spacefile Configuration:

v: 0
micros:
  - name: next-app
    src: ./src/fullstack/next-app
    engine: next