Skip to content
This repository has been archived by the owner on Jun 14, 2024. It is now read-only.

Commit

Permalink
feat: use https if configured
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronjensen committed Jun 16, 2021
1 parent dfb8c9f commit c5b3e02
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ module.exports = function () {
});
await server.listen();
const port = server.config.server.port;
const protocol = server.config.server.https ? "https" : "http"
app.use((ctx, next) => {
ctx.redirect(`http://localhost:${port}${ctx.originalUrl}`);
ctx.redirect(`${protocol}://localhost:${port}${ctx.originalUrl}`);
return;
});
},
Expand Down

0 comments on commit c5b3e02

Please sign in to comment.