I want to do something like
// server.js
app.use('/client', loopback.static(__dirname + '/../client'))
using middleware.json
, but the example only works from the root
"files": {
"loopback#static": {
"params": "$!../client"
}
},
I want to do something like
// server.js
app.use('/client', loopback.static(__dirname + '/../client'))
using middleware.json
, but the example only works from the root
"files": {
"loopback#static": {
"params": "$!../client"
}
},
I created a new file boot/routes.js
var path = require("path");
module.exports = function(app) {
app.get('/ping', function(req, res) {
res.sendFile(pt('client/index.html'));
});
};
function pt(relative) {
return path.resolve(__dirname, '../..', relative);
}