Ship Full-Stack Vite Apps

Nitro extends your Vite application with a production-ready server, compatible with any runtime. Add server routes to your application and deploy many hosting platform with a zero-config experience.

import { defineConfig } from 'vite'
import { nitro } from 'nitro/vite'

export default defineConfig({
  plugins: [
    nitro()
  ],
  nitro: {
    preset: 'standard'
  }
})

Fast

Enjoy the Vite development experience with HMR on the server and optimized for production.

Versatile

Deploy the same codebase to any deployment provider with zero config, no vendor lock-in.

Minimal

Minimal design to fit into any solution with minimum overhead.

Create Server Routes

Start creating API routes in the routes/ folder or start with your favorite backend framework in a server.ts file.

  • routes/
    Create server routes in the routes/ folder and they will be automatically registered.
  • server.ts
    Go full Web standard and pick standard library of your choice to create server routes using the server.ts file.
routes/hello.ts
import { defineHandler } from 'nitro/h3'

export default defineHandler(({ req }) => {
  return { api: 'works!' }
})