-
Notifications
You must be signed in to change notification settings - Fork 511
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: improve readme and getting started
- Loading branch information
Showing
8 changed files
with
120 additions
and
162 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 |
---|---|---|
@@ -0,0 +1 @@ | ||
*.md |
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,111 +1,38 @@ | ||
# ⚗️ Nitro | ||
|
||
[![npm version][npm-version-src]][npm-version-href] | ||
[![npm downloads][npm-downloads-src]][npm-downloads-href] | ||
[![Codecov][codecov-src]][codecov-href] | ||
[![License][license-src]][license-href] | ||
<!-- [![GitHub Actions][github-actions-src]][github-actions-href] [![Codecov][codecov-src]][codecov-href] --> | ||
|
||
Nitro provides a powerful toolchain and a runtime framework from the [UnJS](https://github.com/unjs) ecosystem to build and deploy **any JavaScript server, anywhere.** | ||
|
||
- 📖 [Documentation](https://nitro.unjs.io) | ||
- ✍️ [Changelog](https://github.com/unjs/nitro/blob/main/CHANGELOG.md) | ||
- 🏀 Online playground: [StackBlitz](https://stackblitz.com/github/unjs/nitro/tree/main/examples/hello-world) / [CodeSandbox](https://codesandbox.io/p/sandbox/nitro-5jssbm) | ||
|
||
## Features | ||
|
||
- 🐇 **Rapid development** experience with hot module replacement <br> | ||
- 😌 **Multi-provider** deployments with a single codebase and zero-configuration<br> | ||
- 💼 **Portable and compact** deployments without `node_modules` dependency <br> | ||
- 📁 **Directory structure** aware to register API routes and more with zero configuration <br> | ||
- 🤏 **Minimal Design** to fit into any solution with minimum overhead <br> | ||
- 🚀 **Code-splitting** and async chunk loading for fast server startup time <br> | ||
- 👕 **TypeScript** fully supported <br> | ||
- 💾 **Multi-driver storage** and caching layer <br> | ||
- 💰 **Route caching** and static **pre-rendering** with built-in crawler <br> | ||
- 🐱 **Hackable** to extend almost any part of nitro using options <br> | ||
- ✨ **Auto imports** for lazy folks and a tidy minimal codebase <br> | ||
- 🏛️ **Best-effort compatibility** for using legacy npm packages and mocking Node.js modules <br> | ||
|
||
## Who is using Nitro? | ||
|
||
[Nuxt](https://nuxt.com) is using Nitro as its [server engine](https://nuxt.com/docs/guide/concepts/server-engine). | ||
|
||
## 😺 Quick Start | ||
|
||
Create an empty directory `nitro-app` | ||
|
||
```bash | ||
mkdir nitro-app | ||
cd nitro-app | ||
``` | ||
|
||
Create a `routes/index.ts`: | ||
|
||
```ts | ||
export default defineEventHandler(() => "Hello from Nitro"); | ||
``` | ||
|
||
Start the development server: | ||
|
||
```bash | ||
npx nitropack dev | ||
``` | ||
|
||
🪄 Your API is ready at `http://localhost:3000/` | ||
|
||
Check `.nitro/dev/index.mjs` if want to know what is happening. | ||
|
||
Build your production-ready server: | ||
|
||
```bash | ||
npx nitropack build | ||
``` | ||
|
||
The output is in the `.output` directory and ready to be deployed on almost any VPS with no dependencies. You can locally try it too: | ||
|
||
```bash | ||
node .output/server/index.mjs | ||
``` | ||
|
||
That simple! Read the [documentation](https://nitro.unjs.io) to learn more. | ||
|
||
### Contributing | ||
|
||
Clone the repository and install the dependencies using [pnpm](https://pnpm.io/) and stub nitropack: | ||
|
||
```sh | ||
pnpm i | ||
npm run stub | ||
``` | ||
|
||
Run the local [playground/](./playground): | ||
|
||
```sh | ||
npm run dev | ||
``` | ||
|
||
Run the [tests](./test) with [Vitest](https://vitest.dev): | ||
|
||
```sh | ||
npm run test | ||
``` | ||
|
||
Checkout the 🐛 [open issues](https://github.com/unjs/nitro/issues) for the known issues and roadmap or tell us 💡 [your ideas](https://github.com/unjs/nitro/discussions/new). | ||
<p align="center"> | ||
<a href="https://nitro.unjs.io" target="_blank" rel="noopener noreferrer"> | ||
<img width="180" src="./docs/public/nitro.svg" alt="Nitro logo"> | ||
</a> | ||
</p> | ||
<p align="center"> | ||
<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> | ||
<br/> | ||
|
||
# Nitro | ||
|
||
> Build and deploy universal web servers | ||
> The open engine powering [Nuxt](https://nuxt.com) and [open to everyone](https://github.com/unjs/nitro/discussions/1015). | ||
- 🐇 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 | ||
|
||
📖 Read [the documentation](https://nitro.unjs.io) to learn more or directly jump to the [getting started](https://nitro.unjs.io/guide/introduction/getting-started). | ||
|
||
## Contribution | ||
|
||
See [contribution guide](https://nitro.unjs.io/guide/community/contribution). | ||
|
||
## License | ||
|
||
Made with 💛 Published under [MIT](./LICENSE). | ||
|
||
<!-- Badges --> | ||
|
||
[npm-version-src]: https://img.shields.io/npm/v/nitropack?style=flat&colorA=18181B&colorB=F0DB4F | ||
[npm-version-href]: https://npmjs.com/package/nitropack | ||
[npm-downloads-src]: https://img.shields.io/npm/dm/nitropack?style=flat&colorA=18181B&colorB=F0DB4F | ||
[npm-downloads-href]: https://npmjs.com/package/nitropack | ||
[github-actions-src]: https://flat.badgen.net/github/status/unjs/nitro?style=flat-square | ||
[github-actions-href]: https://github.com/unjs/nitro/actions?query=workflow%3Aci | ||
[codecov-src]: https://img.shields.io/codecov/c/gh/unjs/nitro/main?style=flat&colorA=18181B&colorB=F0DB4F | ||
[codecov-href]: https://codecov.io/gh/unjs/nitro | ||
[license-src]: https://img.shields.io/github/license/unjs/nitro.svg?style=flat&colorA=18181B&colorB=F0DB4F | ||
[license-href]: https://github.com/unjs/nitro/blob/main/LICENSE | ||
Made with 💛 Published under the [MIT](./LICENSE) license. |
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,40 +1,40 @@ | ||
export default defineAppConfig({ | ||
docus: { | ||
title: '⚗️ Nitro', | ||
title: "Nitro", | ||
header: { | ||
title: false, | ||
logo: true | ||
logo: true, | ||
}, | ||
description: 'Build and Deploy Universal JavaScript Servers.', | ||
url: 'https://nitro.unjs.io', | ||
image: '/cover.png', | ||
description: "Build and Deploy Universal JavaScript Servers.", | ||
url: "https://nitro.unjs.io", | ||
image: "/cover.png", | ||
socials: { | ||
twitter: 'unjsio', | ||
github: 'unjs/nitro' | ||
twitter: "unjsio", | ||
github: "unjs/nitro", | ||
}, | ||
github: { | ||
owner: 'unjs', | ||
repo: 'nitro', | ||
branch: 'main', | ||
dir: 'docs/content', | ||
edit: true | ||
owner: "unjs", | ||
repo: "nitro", | ||
branch: "main", | ||
dir: "docs/content", | ||
edit: true, | ||
}, | ||
aside: { | ||
level: 1 | ||
level: 1, | ||
}, | ||
footer: { | ||
credits: { | ||
icon: '', | ||
text: 'Made with 💛', | ||
href: 'https://github.com/unjs/nitro' | ||
icon: "", | ||
text: "Made with 💛", | ||
href: "https://github.com/unjs/nitro", | ||
}, | ||
iconLinks: [ | ||
{ | ||
href: 'https://unjs.io', | ||
icon: 'vscode-icons:file-type-js-official', | ||
label: 'UnJS' | ||
} | ||
] | ||
} | ||
} | ||
}) | ||
href: "https://unjs.io", | ||
icon: "vscode-icons:file-type-js-official", | ||
label: "UnJS", | ||
}, | ||
], | ||
}, | ||
}, | ||
}); |
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,5 +1,6 @@ | ||
<template> | ||
<span style="overflow: hidden;"> | ||
⚗️ Nitro | ||
<span style="overflow: hidden"> | ||
<img width="30" src="/nitro.svg" alt="Nitro Logo" style="display: inline" /> | ||
Nitro | ||
</span> | ||
</template> |
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
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.