8000 Cannot use `app.use` with a `base` that contains more than one slash · Issue #217 · lukeed/polka · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Cannot use app.use with a base that contains more than one slash #217
Open
@Maluscat

Description

@Maluscat

Hi (again :)!

While trying to get Polka up and running, I have noticed that app.use(base, ...fn) does not work when you use a base value that contains more than one "folder".

Most minimal functioning example, assuming the existence of a local folder structure ./static/script/**, e.g. ./static/script/main.js:

import Polka from 'polka';
import Sirv from 'sirv';

const app = Polka();

// Works: /baz/main.js
app.use('/baz', Sirv('./static/script'));
// 404:   /foo/bar/main.js
app.use('/foo/bar', Sirv('./static/script'));

app.listen(8001);

Am I missing something?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0