-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
serve precompressed, fix basic-auth import path
- Loading branch information
1 parent
2622d5a
commit c50f77b
Showing
1 changed file
with
4 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
import Server from "lume/core/server.ts"; | ||
import { basicAuth } from "https://deno.land/x/[email protected]/middlewares/basic_auth.ts"; | ||
import { basicAuth } from "lume/middlewares/basic_auth.ts" | ||
import precompress from "lume/middlewares/precompress.ts"; | ||
|
||
const server = new Server({ | ||
port: 8000, | ||
|
@@ -22,6 +23,8 @@ server.use((req, next) => { | |
return next(req); | ||
}); | ||
|
||
server.use(precompress()); | ||
|
||
function isProtected(req) { | ||
const url = new URL(req.url); | ||
return url.pathname.includes("/private/"); | ||
|