Как вы добавляете файл в Python?

Попробуйте http://localhost:3001/default.css.

Чтобы иметь /styles в URL вашего запроса, используйте:

app.use("/styles", express.static(__dirname + '/styles'));

Посмотрите примеры на на этой странице :

//Serve static content for the app from the "public" directory in the application directory.

    // GET /style.css etc
    app.use(express.static(__dirname + '/public'));

// Mount the middleware at "/static" to serve static content only when their request path is prefixed with "/static".

    // GET /static/style.css etc.
    app.use('/static', express.static(__dirname + '/public'));

1382
задан Petter 26 January 2019 в 17:17
поделиться