Difficulty with absolute and relative paths in Express

后端 未结 5 679
挽巷
挽巷 2021-01-24 17:59

I have a route for an API in an Express app that looks like this:

app.get(\'/:username/:bookmark/\', function(req, res) {

  // do stuff

})

As

5条回答
  •  星月不相逢
    2021-01-24 18:47

    I think you should go with express routing process.

    Add following line to your app.js file

    app.use(express.static(path.join(__dirname, 'public')));
    

    put your all .css files in {approot}/public/stylesheets folder .

    and in your HTML files add links like following

    
    

提交回复
热议问题