Browse Source

Updated README.md for the new configuration

dependabot/npm_and_yarn/web/prismjs-1.21.0
Max Schmitt 8 years ago
parent
commit
228bea54b0
  1. 18
      README.md
  2. 6
      config.yml
  3. 1
      handlers/handlers_test.go

18
README.md

@ -32,17 +32,19 @@ go build # Build executable
Only execute the [docker-compose.yml](docker-compose.yml) and adjust the environment variables to your needs. Only execute the [docker-compose.yml](docker-compose.yml) and adjust the environment variables to your needs.
### Environment Variables: ### Configuration:
| Environment Variable | Description | Default Value | The configuration is a yaml based file of key value pairs. the default configuration file looks like that:
| ------------------ | ----------- | ------------- |
| SHORTENER_DB_PATH | Relative or absolute path to the bolt DB | main.db | ```yaml
| SHORTENER_LISTEN_ADDR | Address to which the http server should listen to | :8080 | DBPath: main.db # Location of the bolt DB database
| SHORTENER_ID_LENGTH | Length of the random short URL id | 4 | ListenAddr: :8080 # RemoteAddr of the http server. (IP:Port)
ShortedIDLength: 4 # Length of the random generated ID
```
## Clients: ## Clients:
### Gemeral ### General
There is a mechanism integrated, that you can call the `POST` endpoints with the following techniques: There is a mechanism integrated, that you can call the `POST` endpoints with the following techniques:
- application/json - application/json
@ -117,7 +119,7 @@ Next changes sorted by priority
- [x] Fix handler unit tests - [x] Fix handler unit tests
- [x] Switch configuration to Yaml - [x] Switch configuration to Yaml
- [ ] Add Authorization (oAuth e.g. Google) - [ ] Add Authorization (oAuth2 e.g. Google)
- [ ] Add Deletion functionality (depends on the authorization) - [ ] Add Deletion functionality (depends on the authorization)
- [ ] Performance optimization - [ ] Performance optimization
- [ ] Add ability to track the visitors (Referrer, maybe also live) - [ ] Add ability to track the visitors (Referrer, maybe also live)

6
config.yml

@ -1,3 +1,3 @@
DBPath: main.db DBPath: main.db # Location of the bolt DB database
ListenAddr: :8080 ListenAddr: :8080 # RemoteAddr of the http server. (IP:Port)
ShortedIDLength: 4 ShortedIDLength: 4 # Length of the random generated ID

1
handlers/handlers_test.go

@ -237,7 +237,6 @@ func testRedirect(t *testing.T, shortURL, longURL string) {
} }
func getBackend() (func(), error) { func getBackend() (func(), error) {
gin.SetMode(gin.ReleaseMode)
store, err := store.New(testingDBName, 4) store, err := store.New(testingDBName, 4)
if err != nil { if err != nil {
return nil, errors.Wrap(err, "could not create store") return nil, errors.Wrap(err, "could not create store")

Loading…
Cancel
Save