From 2d87c41cdee8351123e3ddd2a536d3b05fd24556 Mon Sep 17 00:00:00 2001 From: Farshid Tavakolizadeh Date: Fri, 11 Jun 2021 17:23:36 +0200 Subject: [PATCH] Move execution instructions to wiki --- README.md | 24 ++++-------------------- main.go | 1 - 2 files changed, 4 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index 276edba..9608499 100644 --- a/README.md +++ b/README.md @@ -44,42 +44,26 @@ Compile from source: ```bash go build ``` -This will result in an executable called `thing-directory` (linux/macOS) or `thing-directory.exe` (windows). +This will result in an executable named `thing-directory` (linux/macOS) or `thing-directory.exe` (windows). -Copy sample configuration files for server and JSON Schema into `conf` directory: -```bash -mkdir -p conf -cp sample_conf/thing-directory.json wot/wot_td_schema.json conf -``` - -Alternatively, download sample config file and schemas: -```bash -curl https://raw.githubusercontent.com/linksmart/thing-directory/master/sample_conf/thing-directory.json --create-dirs -o conf/thing-directory.json -curl https://raw.githubusercontent.com/w3c/wot-thing-description/REC1.0/validation/td-json-schema-validation.json --create-dirs -o conf/wot_td_schema.json -``` - -`conf` is the default directory for configuration files. This can be changed with CLI arguments. - -Get the CLI argument help (linux/macOS): +Get the CLI arguments help (linux/macOS): ```bash $ ./thing-directory -help Usage of ./thing-directory: -conf string Configuration file path (default "conf/thing-directory.json") - -schema string - WoT Thing Description schema file path (default "conf/wot_td_schema.json") -version Print the API version ``` Run (linux/macOS): ```bash -$ ./thing-directory +$ ./thing-directory --conf=sample_conf/thing-directory.json ``` To build and run together: ```bash -go run . +go run . --conf=sample_conf/thing-directory.json ``` Test all packages (add `-v` flag for verbose results): diff --git a/main.go b/main.go index d0ddd49..4a886cf 100644 --- a/main.go +++ b/main.go @@ -39,7 +39,6 @@ const ( var ( confPath = flag.String("conf", "conf/thing-directory.json", "Configuration file path") - schemaPath = flag.String("schema", "conf/wot_td_schema.json", "WoT Thing Description schema file path") version = flag.Bool("version", false, "Print the API version") Version string // set with build flags BuildNumber string // set with build flags