mirror of
https://github.com/SinTan1729/chhoto-url
synced 2024-12-26 07:38:36 -06:00
Cleaned up the auth a bit
This commit is contained in:
parent
f0e339e000
commit
25adf04903
1 changed files with 5 additions and 4 deletions
|
@ -22,9 +22,11 @@ public class App {
|
|||
// Add GZIP compression
|
||||
after(Filters::addGZIP);
|
||||
|
||||
// No need to auth in dev
|
||||
if(System.getenv("dev") == null) {
|
||||
// Authenticate
|
||||
Filter authFilter = Filters.createAuthFilter();
|
||||
before("/index.html", authFilter);
|
||||
before("/api/*", Filters.createAuthFilter());
|
||||
}
|
||||
|
||||
get("/", (req, res) -> {
|
||||
res.redirect("/index.html");
|
||||
|
@ -33,7 +35,6 @@ public class App {
|
|||
|
||||
|
||||
path("/api", () -> {
|
||||
before("/*", authFilter);
|
||||
get("/all", Routes::getAll);
|
||||
post("/new", Routes::addUrl);
|
||||
delete("/:shortUrl", Routes::delete);
|
||||
|
|
Loading…
Reference in a new issue