1
mirror of https://github.com/importantimport/urara-docs.git synced 2024-09-18 18:08:39 +08:00
urara-docs/getting-started/quick-start.md

75 lines
1.8 KiB
Markdown
Raw Permalink Normal View History

2022-02-11 23:04:51 +08:00
# Quick Start
## Fork
You can use this template on GitHub without downloading it locally.
2023-01-13 21:57:01 +08:00
Visit the [**importantimport/urara**](https://github.com/importantimport/urara) repository and click the GitHub, Vercel, or Netlify deploy button below.
2022-02-11 23:04:51 +08:00
## Local Downloads
### Node.js
You must check that Node.js is installed on your computer before downloading.
```bash
node --version
```
2023-01-13 21:57:01 +08:00
If your computer does not have Node.js installed, you will need to [**download and complete the installation**](https://nodejs.org/zh-tw/download).
2022-02-11 23:04:51 +08:00
> For Windows users: make sure the **Add to PATH** option is checked (checked by default)
### pnpm
2023-01-13 21:57:01 +08:00
This item uses the [**pnpm**](https://pnpm.io/zh) package manager by default.
2022-02-11 23:04:51 +08:00
2022-12-23 01:28:33 +08:00
Installed via npm.
2022-02-11 23:04:51 +08:00
```bash
2022-12-27 01:50:01 +08:00
npm i -g pnpm
2022-02-11 23:04:51 +08:00
```
2023-01-13 21:57:01 +08:00
For other installation methods, please refer to the [**official documentation**](https://pnpm.io/zh/installation).
2022-02-11 23:04:51 +08:00
### degit
Use `degit` to download the template and install the dependency packages:
2022-02-11 23:04:51 +08:00
```bash
pnpm dlx degit importantimport/urara # Download to the current directory
2022-02-11 23:04:51 +08:00
# or
pnpm dlx degit importantimport/urara my-blog && cd my-blog # Create a new my-blog in the current directory and download it to that folder, then go to
2022-02-11 23:04:51 +08:00
pnpm i # Install the dependency package
2022-02-11 23:04:51 +08:00
```
## Run
### Development
Use `pnpm dev` to run the development server.
2022-02-11 23:04:51 +08:00
```bash
pnpm dev # http://localhost:3000
pnpm dev -- --host 0.0.0.0 # http://0.0.0.0:3000
pnpm dev -- --host 0.0.0.0 --port 8080 # http://0.0.0.0:8080
2022-02-11 23:04:51 +08:00
```
### Deployment
This template uses `adapter-auto` by default and automatically falls back to `adapter-static` when no compatible environment is detected.
Use `pnpm build` to generate the deployment file.
2022-02-11 23:04:51 +08:00
```bash
pnpm build
2022-02-11 23:04:51 +08:00
```
or to force the use of a specific adapter.
```bash
VERCEL=true pnpm build # adapter-vercel
2022-02-11 23:04:51 +08:00
CF_PAGES=true # adapter-cloudflare-pages
NETLIFY=true pnpm build # adapter-netlify
2022-02-11 23:04:51 +08:00
```