Skip to content

Commit

Permalink
more readme
Browse files Browse the repository at this point in the history
  • Loading branch information
sters committed Dec 27, 2019
1 parent 0d3616d commit 36a93c9
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
21 changes: 20 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,28 @@

onstatic is static page hosting controller.

## Quick Start

Start application from [Releases](https://github.com/sters/onstatic/releases) or yourself.
```
go run cmd/server/main.go
```

and see [conf/conf.go](conf/conf.go), [onstatic/handler.go](onstatic/handler.go).
Then, do register. Like this.
```
curl -X POST -H "X-ONSTATIC-KEY: onstaticonstaticonstatic" -H "X-ONSTATIC-REPONAME: git@github.com:sters/onstatic.git" localhost:18888/register
```
And you can get SSH Public Key that register to Your git repository's access authentication.

Finally, do pull. Like this:
```
curl -v -X POST -H "X-ONSTATIC-KEY: onstaticonstaticonstatic" -H "X-ONSTATIC-REPONAME: git@github.com:sters/onstatic.git" localhost:18888/pull
```
You can get hashed repository name. Try access `localhost:18888/{Hashed Repository Name}/{your file path}`.



## Other Informations

See [conf/conf.go](conf/conf.go), [onstatic/handler.go](onstatic/handler.go).

2 changes: 1 addition & 1 deletion onstatic/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ func handlePull(res http.ResponseWriter, req *http.Request) {

log.Print("pull success: ", reponame)
res.WriteHeader(http.StatusOK)
res.Write([]byte("ok"))
res.Write([]byte(reponame))
return
}

Expand Down

0 comments on commit 36a93c9

Please sign in to comment.