8000 docs: fix on mobile long path · nitrojs/nitro@1d2f57e · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Commit 1d2f57e

Browse files
authored
docs: fix on mobile long path
1 parent c578df8 commit 1d2f57e

File tree

4 files changed

+49
-23
lines changed

4 files changed

+49
-23
lines changed

docs/content/1.guide/1.introduction/0.getting-started.md

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ Let's create a new Nitro app in few steps.
44

55
## Play Online
66

7-
:button-link[Open on Stackblitz]{href="https://stackblitz.com/github/unjs/nitro/tree/main/examples/hello-world" icon="simple-icons:stackblitz" blank style="margin-right: 10px;"}
7+
:button-link[Open on Stackblitz]{href="https://stackblitz.com/github/unjs/nitro/tree/main/examples/hello-world" icon="simple-icons:stackblitz" blank style="margin-right: 10px;margin-bottom:10px;"}
88
:button-link[Open on CodeSandox]{href="https://codesandbox.io/p/sandbox/nitro-template-5jssbm" icon="simple-icons:codesandbox" blank}
99

10-
## Using Starter Template
10+
## Starter Template
1111

1212
Before getting started, please make sure you have installed the recommended setup:
1313

@@ -17,7 +17,6 @@ Before getting started, please make sure you have installed the recommended setu
1717

1818
Create a new project using starter template:
1919

20-
2120
::code-group
2221

2322
```bash [npx]
@@ -53,10 +52,10 @@ pnpm install
5352
::
5453

5554

56-
Start development server:
55+
Start the development server:
5756

5857
```bash
59-
npx nitropack dev
58+
npm run dev
6059
```
6160

6261
🪄 Your API is ready at `http://localhost:3000/`
@@ -65,15 +64,17 @@ npx nitropack dev
6564
Check `.nitro/dev/index.mjs` if want to know what is happening
6665
::
6766

68-
You can now build your production-ready server:
67+
Build your production-ready server:
6968

7069
```bash
71-
npx nitropack build
70+
npm run build
7271
````
7372

74-
Output is in the `.output` directory and ready to be deployed on almost any provider with no dependencies. You can locally try it too:
73+
Output is in the `.output` directory and ready to be deployed on almost any provider with no dependencies.
74+
75+
You can try it locally with:
7576

7677
```bash
77-
node .output/server/index.mjs
78+
npm run preview
7879
```
7980

Lines changed: 25 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,37 @@
11
# Configuration
22

3-
Customize your Nitro app with a configuration file.
3+
You can customize your Nitro server with single configuration file: `nitro.config.ts`.
44

5-
In order to customize nitro's behavior, we can use `nitro.config.ts`.
5+
All deployment providers are built on the same options API.
66

7-
It is powerful enough that all deployment providers are built on the same options API.
8-
9-
Create a new `nitro.config.ts` file to provide options:
7+
If you are using [Nuxt](https://nuxt.com), use the `nitro` option in your Nuxt config.
108

9+
::code-group
1110
```ts [nitro.config.ts]
1211
import { defineNitroConfig } from 'nitropack'
1312

1413
export default defineNitroConfig({
15-
// Your options
14+
// Nitro options
15+
})
16+
```
17+
```ts [nuxt.config.ts]
18+
export default defineNuxtConfig({
19+
nitro: {
20+
// Nitro options
21+
}
1622
})
1723
```
18-
19-
::alert
20-
**More Features Available!**
21-
:br
22-
Nitro handles configuration loading using [unjs/c12](https://github.com/unjs/c12). You have more advanced possibilities such as using `.env`. And `.nitrorc`.
2324
::
25+
26+
Read all the [available options](/config) to configure Nitro.
27+
28+
Nitro loads the configuration using [unjs/c12](https://github.com/unjs/c12), giving more possibilities such as using `.nitrorc`.
29+
30+
::code-group
31+
```txt [.nitrorc]
32+
timing=true
33+
```
34+
```txt [.nuxtrc]
35+
nitro.timing=true
36+
```
37+
::

docs/content/1.guide/1.introduction/2.auto-imports.md

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,26 @@
11
# Auto Imports
22

3-
Nitro is integrated with [unjs/unimport](https://github.com/unjs/unimport) and automatically imports utilities by usage with full tree-shaking support.
3+
Nitro is using [unjs/unimport](https://github.com/unjs/unimport) to auto import utilities when used with full tree-shaking support.
44

55
## Available Auto Imports
66

7+
- `defineCachedFunction(fn, options)`{lang=ts} / `cachedFunction(fn, options)`{lang=ts}
8+
- `defineCachedEventHandler(handler, options)`{lang=ts}
9+
- `cachedEventHandler(handler, options)`{lang=ts}
10+
- `useRuntimeConfig()`{lang=ts}
11+
- `useStorage(base?)`{lang=ts}
12+
- `useNitroApp()`{lang=ts}
13+
- `defineNitroPlugin(plugin)`{lang=ts}
14+
- `nitroPlugin(plugin)`{lang=ts}
15+
- `defineRenderHandler`
16+
"getRouteRules",
17+
718
Check [the source code](https://github.com/unjs/nitro/blob/main/src/imports.ts) for list of available auto imports.
819

920
With [TypeScript](/guide/introduction/typescript) enabled, you can easily see them as global utilities in your IDE.
1021

1122
::alert{type="info"}
12-
Run `npx nitropack prepare` to generate the types for global auto-imports.
23+
The types are auto generated for global auto-imports when running the `prepare` or `dev` command.
1324
::
1425

1526
## Manual Imports

docs/content/1.guide/1.introduction/5.cache.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ export default eventHandler(async (event) => {
9999
```
100100
::
101101

102-
The stars will be cached in development inside `.nitro/cache/functions/ghStars/<owner>/<repo>.json` with `value` being the number of stars.
102+
The stars will be cached in development inside **.nitro/cache/functions/ghStars/&lt;owner&gt;/&lt;repo&gt;.json** with `value` being the number of stars.
103103

104104
```json
105105
{"expires":1677851092249,"value":43991,"mtime":1677847492540,"integrity":"ZUHcsxCWEH"}

0 commit comments

Comments
 (0)
0