serve .ts too
This commit is contained in:
parent
c2f0e0a990
commit
a8102a2730
|
|
@ -42,8 +42,8 @@ app.use("*", async (c, next) => {
|
||||||
app.on("GET", ["/js/:path{.+}", "/shared/:path{.+}"], async c => {
|
app.on("GET", ["/js/:path{.+}", "/shared/:path{.+}"], async c => {
|
||||||
const path = "./src/" + c.req.path.replace("..", ".")
|
const path = "./src/" + c.req.path.replace("..", ".")
|
||||||
|
|
||||||
// path must end in .js
|
// path must end in .js or .ts
|
||||||
if (!path.endsWith(".js")) return c.text("File not found", 404)
|
if (!path.endsWith(".js") && !path.endsWith(".ts")) return c.text("File not found", 404)
|
||||||
|
|
||||||
const ts = path.replace(".js", ".ts")
|
const ts = path.replace(".js", ".ts")
|
||||||
if (isFile(ts)) {
|
if (isFile(ts)) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user