* Migrated ur an sqlite database

* Removed unnecessary IOExceptions

* Removed an util class not needed anymore

* Updated README.md and docker-compose.yml to reflect new storage mechanism

* This change was not meant for this branch

* Port change with environment variable

* Unused imports

* Updated README.md

* Added basic protection against duplication
This commit is contained in:
Przemek Dragańczuk
2020-05-23 19:16:27 +02:00
committed by GitHub
parent 425b8a5f44
commit 218f2fa368
4 changed files with 19 additions and 11 deletions

View File

@@ -1,7 +1,5 @@
package tk.draganczuk.url;
import spark.Filter;
import static spark.Spark.*;
public class App {
@@ -17,13 +15,13 @@ public class App {
staticFiles.location("/public");
}
port(Integer.parseInt(System.getProperty("port", "4567")));
port(Integer.parseInt(System.getenv().getOrDefault("port", "4567")));
// Add GZIP compression
after(Filters::addGZIP);
// No need to auth in dev
if(System.getenv("dev") == null) {
if (System.getenv("dev") == null) {
// Authenticate
before("/api/*", Filters.createAuthFilter());
}