Docs
Create web servers with all necessary features and deploy them wherever you prefer.
#Getting Started
#Intro
Nitro is an open source framework to build web servers using h3 and lots of built-in features. Nitro automatically makes your code compatible with any deployment provider and runtime!
Note
Nitro can be used standalone or as the server engine of full-stack frameworks such as Nuxt.
#Quick start
Tip
Instead of setting up a local development environment, you can use the online playground.
Note
Make sure you have installed the recommended setup:
- Latest LTS version of either Node.js, Bun, or Deno.
- Visual Studio Code
Create a new project using starter template:
npx giget@latest nitro nitro-app --installcd nitro-appStart the development server:
npm run devNitro is ready at http://localhost:3000/!
Tip
Check .nitro/dev/index.mjs if you want to know what is happening
Build your production-ready server:
npm run buildOutput is in the .output directory and ready to be deployed on almost any provider with no dependencies.
You can try it locally with:
npm run preview#Directory structure
The starter template includes some important files to get you started.
#server/routes/
The server/routes/ directory contains your application handlers. You can create subdirectories inside server/routes/ dir to create nested handlers. The file name is the route path.
#server/api/
The server/api/ directory is similar to server/routes/ with the only difference that routes inside it will be prefixed with /api/ for convenience.
#server/utils/
This directory contains your application utils with auto import support.
#server/plugins/
This directory contains your custom nitro plugins.
#nitro.config.ts
The nitro.config.ts file contains the configuration for Nitro.
#tsconfig.json
The tsconfig.json file contains the TypeScript configuration for your project.
#package.json
The package.json file contains all the dependencies and scripts for your project.