Repository navigation
How add path for listener ? #4761
Replies: 1 comment
|
The URL prefix belongs in the routing/static-file configuration. For example, if const express = require('express')
const path = require('node:path')
const app = express()
app.use('/some-path', express.static(path.join(__dirname, 'dist')))
app.listen(3000)Then the file is served at There is also a separate client-side URL issue. In unbundled modules,
Mounting the Express directory does not rewrite the URLs already emitted by your bundler. Check the loaded module URL and generated worker URL in the browser's network panel. If the build emits the root URL, set the bundler's deployment base/public-path setting to match References: Express static mount paths, application API, URL resolution. Checked on Node 24.18.0 / Express 5.3.0 with a local server: the prefixed worker request returned the file (200), the unmounted root request returned 404, and the three URL-resolution cases above passed. This does not test your bundle, browser worker registration, proxy, or GitHub Pages deployment. Prepared and checked with OpenAI Codex assistance. |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Hi.
I am created server
It is listen
http://localhost:portI have bundle what in web have path
https://site/some-pathI can't create route because my service worker get path from
root dirand it is request not go for routeIt is worker url.
On github pages it is work and path is true.
It's look like this
How can i create listener for path ?
Example
All reactions