-
Notifications
You must be signed in to change notification settings - Fork 508
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into pr/JaZo/1976
- Loading branch information
Showing
135 changed files
with
3,911 additions
and
11,253 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -73,6 +73,7 @@ playground/firebase.json | |
.zeabur | ||
|
||
test/fixture/functions | ||
.data | ||
|
||
.pnpm-store | ||
.wrangler |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,46 @@ | ||
<p> | ||
<a href="https://nitro.unjs.io" target="_blank" rel="noopener noreferrer"> | ||
<img src="./docs/public/cover.png" alt="Nitro logo"> | ||
</a> | ||
</p> | ||
<p> | ||
<a href="https://npmjs.com/package/nitropack"><img src="https://img.shields.io/npm/v/nitropack?style=flat&colorA=18181B&colorB=d8c449" alt="npm version"></a> | ||
<a href="https://npmjs.com/package/nitropack"><img src="https://img.shields.io/npm/dm/nitropack?style=flat&colorA=18181B&colorB=d8c449" alt="npm downloads"></a> | ||
<a href="https://github.com/unjs/nitro/blob/main/LICENSE"><img src="https://img.shields.io/github/license/unjs/nitro.svg?style=flat&colorA=18181B&colorB=d8c449" alt="License"></a> | ||
</p> | ||
|
||
# Nitro | ||
|
||
Create web servers that run *anywhere*. The open engine powering [Nuxt](https://nuxt.com) and [open to everyone](https://github.com/unjs/nitro/discussions/1015). | ||
<!-- automd:badges --> | ||
|
||
[![npm version](https://flat.badgen.net/npm/v/nitropack)](https://npmjs.com/package/nitropack) | ||
[![npm downloads](https://flat.badgen.net/npm/dm/nitropack)](https://npmjs.com/package/nitropack) | ||
|
||
- 🐇 Rapid development with HMR | ||
- 😌 Provider agnostic deployments with 15+ built-in presets | ||
- 💼 Portable and compact output | ||
- 📁 Directory structure conventions | ||
- 🤏 Minimal design | ||
- 🚀 Code-splitting | ||
- 👕 TypeScript support | ||
- 💾 Universal storage | ||
- 💰 Route caching | ||
- 🐱 Hackable | ||
- ✨ Auto Imports | ||
<!-- /automd --> | ||
|
||
📖 Read [the documentation](https://nitro.unjs.io) to learn more or directly jump to the [getting started](https://nitro.unjs.io/guide/getting-started). | ||
Create web servers that run anywhere! 📖 [**documentation**](https://nitro.unjs.io) | ||
|
||
## Contribution | ||
|
||
See [contribution guide](https://nitro.unjs.io/guide/community/contributing). | ||
<details> | ||
<summary>Local development</summary> | ||
|
||
- Clone this repository | ||
- Install the latest LTS version of [Node.js](https://nodejs.org/en/) | ||
- Enable [Corepack](https://github.com/nodejs/corepack) using `corepack enable` | ||
- Install dependencies using `pnpm install` | ||
- Run tests using `pnpm dev` or `pnpm test` | ||
|
||
</details> | ||
|
||
<!-- /automd --> | ||
|
||
## License | ||
|
||
Made with 💛 Published under the [MIT](./LICENSE) license. | ||
<!-- automd:contributors license=MIT author="pi0" --> | ||
|
||
Published under the [MIT](https://github.com/unjs/nitro/blob/main/LICENSE) license. | ||
Made by [@pi0](https://github.com/pi0) and [community](https://github.com/unjs/nitro/graphs/contributors) 💛 | ||
<br><br> | ||
<a href="https://github.com/unjs/nitro/graphs/contributors"> | ||
<img src="https://contrib.rocks/image?repo=unjs/nitro" /> | ||
</a> | ||
|
||
<!-- /automd --> | ||
|
||
<!-- automd:with-automd --> | ||
|
||
--- | ||
|
||
_🤖 auto updated with [automd](https://automd.unjs.io)_ | ||
|
||
<!-- /automd --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
# yaml-language-server: $schema=https://unpkg.com/undocs/schema/config.json | ||
name: Nitro | ||
shortDescription: Next Generation Server Toolkit | ||
description: Create web servers with everything you need and deploy them wherever you prefer. | ||
github: unjs/nitro | ||
url: https://nitro.unjs.io | ||
themeColor: "red" | ||
automd: true | ||
redirects: | ||
/deploy/node: /deploy/runtimes/node | ||
landing: | ||
heroLinks: | ||
playOnline: | ||
label: "Play Online" | ||
icon: "i-simple-icons-lightning" | ||
to: "https://stackblitz.com/github/unjs/nitro/tree/main/examples/hello-world" | ||
contributors: true | ||
featuresTitle: "A Server for the Modern Web" | ||
features: | ||
- title: "Rapid Development" | ||
description: "Zero config setup with hot module replacement for server code in development." | ||
icon: "🐇" | ||
- title: "Deploy Anywhere" | ||
description: "Deploy the same codebase to any [deployment provider](/deploy) with no extra config." | ||
icon: "😌" | ||
- title: "Portable and Compact" | ||
description: "Say goodbye to `node_modules`, output size is less than 1MB." | ||
icon: "💼" | ||
- title: "Filesystem Routing" | ||
description: "[Automatically registers](/guide/routing) server and API routes." | ||
icon: "📁" | ||
- title: "Minimal Design" | ||
description: "Minimal design to fit into any solution with minimum overhead" | ||
icon: "🤏" | ||
- title: "Code-Splitting" | ||
description: "Async chunk loading for fast server startup time and answer." | ||
icon: "🚀" | ||
- title: "TypeScript" | ||
description: "TypeScript support out of the box with few more goodies." | ||
icon: "👕" | ||
- title: "Storage Layer" | ||
description: "Multi driver and platform-agnostic storage system." | ||
icon: "💾" | ||
- title: "Cache API" | ||
description: "Powerful built-in caching API." | ||
icon: "💰" | ||
- title: "Hackable" | ||
description: "Built to be customized with the [plugins](/guide/plugins) hooks system." | ||
icon: "🐱" | ||
- title: "Auto Imports" | ||
description: "Automatically import utilities for a minimal and clean codebase. Only the used ones will be added to the final bundle." | ||
icon: "✨" | ||
- title: "Backward Compatible" | ||
description: "So you can use legacy npm packages, CommonJS and mocking Node.js modules for workers." | ||
icon: "🏛️" |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
--- | ||
icon: ph:book-open-duotone | ||
--- | ||
|
||
# Getting Started | ||
|
||
> Create web servers with all necessary features and deploy them wherever you prefer. | ||
## Intro | ||
|
||
Nitro is an open source framework to build web servers using [unjs/h3](https://h3.unjs.io) and lots of built-in features. | ||
Nitro automatically makes your code compatible with any [deployment](/deploy) provider and runtime! | ||
|
||
> [!NOTE] | ||
> Nitro can be used standalone or as the server engine of full-stack frameworks such as [Nuxt](https://nuxt.com). | ||
|
||
## Quick start | ||
|
||
> [!TIP] | ||
> Instead of setting up a local development envirionment, you can use the [online playground](https://stackblitz.com/github/unjs/nitro/tree/main/examples/hello-world). | ||
::note | ||
Make sure you have installed the recommended setup: | ||
|
||
- Latest LTS version of [Node.js](https://nodejs.org/en), or [Bun](https://bun.sh/). | ||
- [Visual Studio Code](https://code.visualstudio.com/) | ||
:: | ||
|
||
Create a new project using starter template: | ||
|
||
:pm-x{command="giget@latest nitro nitro-app --install"} | ||
|
||
|
||
```sh | ||
cd nitro-app | ||
``` | ||
|
||
Start the development server: | ||
|
||
:pm-run{script="dev"} | ||
|
||
Nitro is ready at `http://localhost:3000/`! | ||
|
||
::tip | ||
Check `.nitro/dev/index.mjs` if want to know what is happening | ||
:: | ||
|
||
Build your production-ready server: | ||
|
||
:pm-run{script="build"} | ||
|
||
Output is in the `.output` directory and ready to be deployed on almost any provider with no dependencies. | ||
|
||
You can try it locally with: | ||
|
||
:pm-run{script="preview"} | ||
|
||
::read-more | ||
You can find more examples in the Nitro repository: [unjs/nitro/examples](https://github.com/unjs/nitro/tree/main/examples) | ||
:: | ||
|
||
## Directory structure | ||
|
||
The starter template some important files to get you started. | ||
|
||
### `routes/` | ||
|
||
The `routes/` directory contains your application handlers. You can create subdirectories inside `routes/` dir to create nested handlers. The file name is the route path. | ||
|
||
:read-more{to="/guide/routing"} | ||
|
||
### `api/` | ||
|
||
The `api/` directory is similar to `route/` with only difference that routes inside it will be prefixed with `/api/` for convenience. | ||
|
||
:read-more{to="/guide/routing"} | ||
|
||
### `utils/` | ||
|
||
This directory contains your application utils with auto import support. | ||
|
||
:read-more{to="/guide/utils"} | ||
|
||
### `plugins/` | ||
|
||
This directory contains your custom nitro plugins. | ||
|
||
:read-more{to="/guide/plugins"} | ||
|
||
### `nitro.config.ts` | ||
|
||
The `nitro.config.ts` file contains the configuration for Nitro. | ||
|
||
:read-more{to="/guide/configuration"} | ||
|
||
### `tsconfig.json` | ||
|
||
The `tsconfig.json` file contains the TypeScript configuration for your project. | ||
|
||
:read-more{to="/guide/typescript"} | ||
|
||
### `package.json` | ||
|
||
The `package.json` file contains all the dependencies and scripts for your project. |
Oops, something went wrong.