Surge是面向前端开发人员的静态web发布网站。
安装
# 1. 安装node
# 2. 安装surge
npm install --global surge
help
$ surge --help
surge – single command web publishing. (v0.23.1)
Usage:
surge <project> <domain>
Options:
-a, --add adds user to list of collaborators (email address)
-r, --remove removes user from list of collaborators (email address)
-V, --version show the version number
-h, --help show this help message
Additional commands:
surge whoami show who you are logged in as
surge logout expire local token
surge login only performs authentication step
surge list list all domains you have access to
surge teardown tear down a published project
surge plan set account plan
Guides:
Getting started surge.sh/help/getting-started-with-surge
Custom domains surge.sh/help/adding-a-custom-domain
Additional help surge.sh/help
When in doubt, run surge from within your project directory.
发布
# 进入待发布的目录
cd <to-public-dir>
# 发布
$ surge
Welcome to surge! (surge.sh)
Login (or create surge account) by entering email & password.
email: me@xiexianbin.cn
password: Surge2022
Running as me@xiexianbin.cn (Student)
project: D:\code\public\
domain: fallacious-action.surge.sh
encryption: *.surge.sh, surge.sh (185 days)
IP: 138.197.235.123
Success! - Published to fallacious-action.surge.sh
F&Q
出现 Aborted - you do not have permission to publish to *.surge.sh
时,可能是域名被占用,多尝试几次就行