Setting up two different static directories in node.js Express framework

后端 未结 6 701
北恋
北恋 2020-11-30 22:21

Is it possible? I would like to set up two different directories to serve static files. Let\'s say /public and /mnt

6条回答
  •  情深已故
    2020-11-30 22:38

    use :dir instead of *

    eg

    this.app.use('/:microsite', express.static(path.resolve(process.cwd(), 'client/')))
    

提交回复
热议问题