Skip to content

Instantly share code, notes, and snippets.

@JonForest
Created September 12, 2016 09:05
Show Gist options
  • Select an option

  • Save JonForest/64b506f1921172f4df535fe65a368b82 to your computer and use it in GitHub Desktop.

Select an option

Save JonForest/64b506f1921172f4df535fe65a368b82 to your computer and use it in GitHub Desktop.
const path = require('path')
module.exports = function (server) {
const publicPath = path.resolve(__dirname, '..', 'public')
server.use('/public', server.loopback.static(publicPath))
const clientPath = path.resolve(__dirname, '..', '..', 'client', 'dist')
server.use('/assets', server.loopback.static(path.resolve(clientPath, 'assets')))
server.use('/fonts', server.loopback.static(path.resolve(clientPath, 'fonts')))
server.get('/robots.txt', (req, res) => {
res.sendFile(path.resolve(clientPath, 'robots.txt'))
})
// serve ember index file on /
server.get('*', (req, res) => {
res.sendFile(path.resolve(clientPath, 'index.html'))
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment