search

Home  >  Q&A  >  body text

html - node.js中base标签中href的问题

我在node.js中的express中使用static中间件为static(__dirname+'/public'),html中的代码为

我想问一下base标签中的href属性为'/'是什么意思?不是一般都为http...这种属性值么?

ringa_leeringa_lee2903 days ago825

reply all(1)I'll reply

  • 巴扎黑

    巴扎黑2017-04-17 15:48:11

    app.use(express.static(__dirname+'/public'));
    This line of code is to set the base_url of your static resource
    So in the page <base href="/"> / represents what you set Static resource path

    reply
    0
  • Cancelreply