提交 a046245b 编写于 作者: kingreatwill's avatar kingreatwill

命令行服务器

上级 1ddb25b3
[TOC]
go mod 1.13
https://github.com/golang/go/wiki/Modules
......@@ -87,7 +88,11 @@ We do this by using our good old friend go get:
version 1.0.1. go get -u will not get version 2.0.0.
### go get 指定版本
```
go get github.com/kataras/iris/v12@master
go get github.com/kataras/iris/v12@v12.2.0-alpha2
```
### Go1.17 go get变化
go get 只用来下载普通的包,不做编译和安装(以前go get 有一个 flag -d,指示 go get 下载对应的包,但不做编译和安装。将来的版本,-d 会成为默认行为,这样会更快。此外,因为不编译,即使目标依赖在特定平台编译报错,go get 也能正常执行完。)
......@@ -95,6 +100,10 @@ go install 安装可执行程序
废弃 -insecure;使用 GOINSECURE 环境变量
在模块外,不带 `@version` 是无法安装的!
如果你在模块目录中,并且你不带 `@version` 执行安装的话,只能安装 go.mod 中已经包含的版本。并且不能安装未出现在 go.mod 中的包。
## Module dependencies
![](../img/go/module_gopath.png)
......
......@@ -104,3 +104,51 @@ https://github.com/prettier
- GraphQL
- Markdown, including GFM and MDX
- YAML
## 命令行服务器(最小web服务器)
### dotnet
https://github.com/natemcmaster/dotnet-serve
```
dotnet tool install --global dotnet-serve
dotnet serve -o
```
### jdk 18
经过一周的评审,JEP 408,也就是 Simple Web Server 由 JDK 18 的 Proposed to Target 状态进入到了 Targeted。这个 JEP 提供了一个基于 HTTP 命令行的、最小化的、只提供静态文件的 Web 服务器。这个工具主要用于构建原型、临时编码和测试,特别是在培训环境中。这个 Web 服务器可以通过以下命令来启动:
`java -m jdk.httpserver [-b bind address] [-p port] [-d directory] [-h to show help message] [-o none|default|verbose]`
### python
#### python2
```
python -m SimpleHTTPServer 8888
python -m SimpleHTTPServer 8888 &
nohup python -m SimpleHTTPServer 8000 &
```
#### python3
```
python3 -m http.server 8888
python3 -m http.server 8888 &
nohup python3 -m http.server 8888 &
```
### node
```
npm install -g http-server
http-server <path> -a 0.0.0.0 -p 8080
```
### golang
#### devd
https://github.com/cortesi/devd
```
go install github.com/cortesi/devd/cmd/devd@latest
devd -w ./src http://localhost:8080
# Serve the current directory, open it in the browser (-o), and livereload when files change (-l):
devd -ol .
```
#### Swego
https://github.com/nodauf/Swego
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册