Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
G
go-ipfs
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
jihao
go-ipfs
Commits
8eb95faf
提交
8eb95faf
authored
8月 07, 2014
作者:
verokarhu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
moved http to server/http and implemented serve http subcommand
上级
0a25b64f
隐藏空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
18 行增加
和
9 行删除
+18
-9
README.md
README.md
+1
-1
ipfs.go
cmd/ipfs/ipfs.go
+1
-1
serve.go
cmd/ipfs/serve.go
+16
-7
http.go
server/http/http.go
+0
-0
没有找到文件。
README.md
浏览文件 @
8eb95faf
...
...
@@ -43,7 +43,7 @@ Tool commands:
Advanced Commands:
mount Mount an ipfs read-only mountpoint.
serve Serve an
http gateway in
to ipfs.
serve Serve an
interface
to ipfs.
Use "ipfs help <command>" for more information about a command.
```
...
...
cmd/ipfs/ipfs.go
浏览文件 @
8eb95faf
...
...
@@ -35,7 +35,7 @@ Tool commands:
Advanced Commands:
mount Mount an ipfs read-only mountpoint.
serve Serve an
http gateway in
to ipfs.
serve Serve an
interface
to ipfs.
Use "ipfs help <command>" for more information about a command.
`
,
...
...
cmd/ipfs/serve.go
浏览文件 @
8eb95faf
...
...
@@ -5,23 +5,32 @@ import (
"fmt"
"github.com/gonuts/flag"
"github.com/jbenet/commander"
h
"github.com/jbenet/go-ipfs/http"
h
"github.com/jbenet/go-ipfs/
server/
http"
)
var
cmdIpfsServe
=
&
commander
.
Command
{
UsageLine
:
"serve"
,
Short
:
"Serve an interface to ipfs"
,
Subcommands
:
[]
*
commander
.
Command
{
cmdIpfsServeHttp
,
},
Flag
:
*
flag
.
NewFlagSet
(
"ipfs-serve"
,
flag
.
ExitOnError
),
}
var
cmdIpfsServeHttp
=
&
commander
.
Command
{
UsageLine
:
"http"
,
Short
:
"Serve an HTTP API"
,
Long
:
`ipfs serve - Serve an http gateway into ipfs.`
,
Run
:
serveCmd
,
Flag
:
*
flag
.
NewFlagSet
(
"ipfs-serve"
,
flag
.
ExitOnError
),
Long
:
`ipfs serve
http
- Serve an http gateway into ipfs.`
,
Run
:
serve
Http
Cmd
,
Flag
:
*
flag
.
NewFlagSet
(
"ipfs-serve
-http
"
,
flag
.
ExitOnError
),
}
func
init
()
{
cmdIpfsServe
.
Flag
.
Uint
(
"port"
,
8080
,
"Port number"
)
cmdIpfsServe
.
Flag
.
String
(
"hostname"
,
"localhost"
,
"Hostname"
)
cmdIpfsServe
Http
.
Flag
.
Uint
(
"port"
,
8080
,
"Port number"
)
cmdIpfsServe
Http
.
Flag
.
String
(
"hostname"
,
"localhost"
,
"Hostname"
)
}
func
serveCmd
(
c
*
commander
.
Command
,
_
[]
string
)
error
{
func
serve
Http
Cmd
(
c
*
commander
.
Command
,
_
[]
string
)
error
{
port
:=
c
.
Flag
.
Lookup
(
"port"
)
.
Value
.
Get
()
.
(
uint
)
if
port
<
1
||
port
>
65535
{
return
errors
.
New
(
"invalid port number"
)
...
...
http/http.go
→
server/
http/http.go
浏览文件 @
8eb95faf
File moved
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论