From 51cbfad07823f64f674dbd54be22fac0d978a37a Mon Sep 17 00:00:00 2001 From: "Schmitt, Max" Date: Thu, 9 Nov 2017 09:30:15 +0100 Subject: [PATCH] Fix #7 --- .vscode/settings.json | 4 +--- README.md | 30 +++++++++++++++++++----------- build/schema.md | Bin 0 -> 4248 bytes config/config.go | 30 ++++++++++++++---------------- 4 files changed, 34 insertions(+), 30 deletions(-) create mode 100644 build/schema.md diff --git a/.vscode/settings.json b/.vscode/settings.json index 4be5a42..9e26dfe 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,3 +1 @@ -{ - "prettier.singleQuote": true -} \ No newline at end of file +{} \ No newline at end of file diff --git a/README.md b/README.md index cd1d174..4eb50a1 100644 --- a/README.md +++ b/README.md @@ -31,17 +31,13 @@ TODO ## Configuration -The configuration is a JSON file, an example is located [here](build/config.json). If your editor supports intellisense by using a schema (e.g. [VS Code](https://github.com/Microsoft/vscode)) then you can simply press space for auto completion. - -The config parameters should be really selfexplaning, but here is a detailed description for all of these: - -TODO: Add config parameters +The configuration is a JSON file, an example is located [here](build/config.json). If your editor supports intellisense by using a schema (e.g. [VS Code](https://github.com/Microsoft/vscode)) then you can simply press space for auto completion. The config parameters should be really selfexplaning, but [here](build/schema.md) is a detailed description for all of these: ## OAuth ### Google -Visit [console.cloud.google.com](https://console.cloud.google.com) and create or use an existing project, goto `APIs & Services` -> `Credentials` and create there an `OAuth Client-ID` for the application type `Webapplicaton`. There you get the Client-ID and the ClientSecret for your configuration. It's important, that you set in the Google Cloud Platform `YOUR_URL/api/v1/callback` as authorized redirect URL. +Visit [console.cloud.google.com](https://console.cloud.google.com) and create or use an existing project, go to `APIs & Services` -> `Credentials` and create there an `OAuth Client-ID` for the application type `Webapplicaton`. There you get the Client-ID and the ClientSecret for your configuration. It's important, that you set in the Google Cloud Platform `YOUR_URL/api/v1/callback` as authorized redirect URL. ## Clients @@ -53,18 +49,30 @@ In general the `POST` endpoints can be called, by using one of the following tec - application/x-www-form-urlencoded - multipart/form-data -For all the endpoints which have `protected` in her path there is the `Authorization` header required. +For all the endpoints which are on `/api/v1/protected` there is the `Authorization` header required. ### [ShareX](https://github.com/ShareX/ShareX) -For ShareX usage, we refer to the menu item in the frontend where your configuration will be generated. There are further information for the detailled use. +For ShareX usage, we refer to the menu item in the frontend where your configuration will be generated. There are further information for the detailed use. ## Why did you built this -Just only because I want to extend my current self hosted URL shorter and learn about new techniques like: +Just only because I want to extend my current self hosted URL shorter with some features and learn about new techniques like: -- Golang unit tests +- Golang unit testing - React - Makefiles - Travis CI -- Key / Value databases \ No newline at end of file +- Key / Value databases + +## Utils + +### Update Config Documentation + +``` +yarn global add jsonschema-md +go run build/schema.go +jsonschema-md.cmd build/schema.json > build/schema.md +``` + +After that adjust the title to `Configuration` and the description to `Golang URL Shortener Configuration`. \ No newline at end of file diff --git a/build/schema.md b/build/schema.md new file mode 100644 index 0000000000000000000000000000000000000000..d972ddfe6cb09698af1224580b3e65950ea2a7bd GIT binary patch literal 4248 zcmds)T~AX%5QgX4#Q(4fCa6*L(s0LD6oN{qgbQLwzi6xdvZWvizg>Nwoi69Jrw6DZ zCX$o3XLo03XJ_7dXZrisiUr%Uf%WaoI@Yp@jjU?tdS~vbJ&B(c^C#FByRxA*ZC(2Y zRI_MO;==)p#`cO)%e?YSb*o|}C!-J6etYn$I6qW`>$^4es^2BMMMWo}r8%{qyZgA@@@&uYHebk=t`H0oiZ@87Cwp(RpF6y~ zc^L5_2SOn>`Bj%l_$Er|&a6#EdaO7ne&IgEcQ&&QCGkUe z=tK-Q7GR>PRnLaLemju^>(ZV0FW7}<$=%PkF_m4@Xvfxsdfrx*OXqrqV#GIkdg8~1 zP)^2^l@*g(v9BAcc z%CjK9?{2Ry(@V^19tv-R$g{9sVi&NJuuz7Yyq+Yx9B%R&{^cDX6T-HHEck>9x~n=? z#%M)37zECQxvzwQiGE=k800LXqNg`U)>!Kxn0iV*n~0yN!5OwwrJZFRxHo_DeYm$= zK5y|uTY4KmR^$_}?|+B$Z2w}E-R;+KiX9L& zoqxaHol#5i4fVLDnh1jFJ(%a;himc*?)XQRj<2h=pj_J2cd>iO{!2Gv#_dZZ|0grc z=sh?Gj3!2%m747v@)h56aK74mX6Nzm{nw<>r?B%