From 36a93c9d9911a4009adbe90f533e93ec1b26fc5a Mon Sep 17 00:00:00 2001 From: sters Date: Sat, 28 Dec 2019 01:53:47 +0900 Subject: [PATCH] more readme --- README.md | 21 ++++++++++++++++++++- onstatic/handler.go | 2 +- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 4b5fc97..581f7b7 100644 --- a/README.md +++ b/README.md @@ -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). diff --git a/onstatic/handler.go b/onstatic/handler.go index 540619c..dfedbf3 100644 --- a/onstatic/handler.go +++ b/onstatic/handler.go @@ -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 }