You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Yeah, the send method seems to not work with Deploy. My workaround is something like this:
// Package to help automatically infer the correct mime type based on extensionimportmimefrom'https://cdn.skypack.dev/mime-types'// use this inside your middleware instead of 'send'constrequestMimeType=mime.lookup(ctx.request.url.pathname)constresponseMimeType=mime.contentType(requestMimeType)ctx.response.headers.set('Content-Type',responseMimeType)ctx.response.body=awaitDeno.readTextFile(Deno.cwd()+ctx.request.url.pathname)
Fixed it in Deploy for me. But, this should probably be addressed in Oak too, or at least noted in documentation.
Deno.stat() is being added to Deploy (though it might not totally give everything needed). "Static" files in Deploy is a bit of a moving target at the moment. I will try to make .send() more compatible with it.
oak is advertised as compatible with deno deploy, but doesn't seem to be able to serve static files.
With the minimal repro below, everything works fine with
deployctl
locally ordeno run
, but once deployed it errors upon testing.Would appreciate any suggestions to workaround or fix.
repro
mod.ts
http response
deploy logs
The text was updated successfully, but these errors were encountered: