spacing
This commit is contained in:
parent
864adfa026
commit
8c3ac32578
|
|
@ -98,13 +98,17 @@ export class Hype<
|
||||||
if (!path.endsWith('.js') && !path.endsWith('.ts')) path += '.ts'
|
if (!path.endsWith('.js') && !path.endsWith('.ts')) path += '.ts'
|
||||||
|
|
||||||
const ts = path.replace('.js', '.ts')
|
const ts = path.replace('.js', '.ts')
|
||||||
if (await Bun.file(ts).exists()) {
|
if (await Bun.file(ts).exists())
|
||||||
return new Response(await transpile(ts), { headers: { 'Content-Type': 'text/javascript' } })
|
return new Response(await transpile(ts), { headers: { 'Content-Type': 'text/javascript' } })
|
||||||
} else if (await Bun.file(path).exists()) {
|
|
||||||
|
else if (await Bun.file(ts + 'x').exists())
|
||||||
|
return new Response(await transpile(ts + 'x'), { headers: { 'Content-Type': 'text/javascript' } })
|
||||||
|
|
||||||
|
else if (await Bun.file(path).exists())
|
||||||
return new Response(Bun.file(path), { headers: { 'Content-Type': 'text/javascript' } })
|
return new Response(Bun.file(path), { headers: { 'Content-Type': 'text/javascript' } })
|
||||||
} else {
|
|
||||||
|
else
|
||||||
return render404(c)
|
return render404(c)
|
||||||
}
|
|
||||||
})
|
})
|
||||||
|
|
||||||
// file based routing
|
// file based routing
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user