(url: URL)
| 133 | }; |
| 134 | |
| 135 | const openStaticFile = async (url: URL) => { |
| 136 | const pathname = url.pathname; |
| 137 | const fileName = pathname.slice(url.pathname.lastIndexOf('/')); |
| 138 | let filePath: string; |
| 139 | if (fileName.includes('.')) { |
| 140 | filePath = join(staticFolder, pathname); |
| 141 | } else if (opts.qwikCityPlan.trailingSlash) { |
| 142 | filePath = join(staticFolder, pathname + 'index.html'); |
| 143 | } else { |
| 144 | filePath = join(staticFolder, pathname, 'index.html'); |
| 145 | } |
| 146 | return { |
| 147 | filePath, |
| 148 | // @ts-ignore |
| 149 | content: await Deno.open(filePath, { read: true }), |
| 150 | }; |
| 151 | }; |
| 152 | |
| 153 | const staticFile = async (request: Request) => { |
| 154 | try { |
no test coverage detected
searching dependent graphs…