From d577663ac1b2da0a5a6fabff58646f785c671ba9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20Bajto=C5=A1?= Date: Tue, 2 Dec 2014 11:03:37 +0100 Subject: [PATCH] api-server: remove static middleware placeholder Simplify `server/server.js` template, remove the commented-out placeholder showing how to register static middleware. The new way is to configure static middleware via `server/middleware.json`. --- .../components/api-server/template/server/server.js | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/templates/components/api-server/template/server/server.js b/templates/components/api-server/template/server/server.js index 1795f622..daf536f5 100644 --- a/templates/components/api-server/template/server/server.js +++ b/templates/components/api-server/template/server/server.js @@ -3,17 +3,10 @@ var boot = require('loopback-boot'); var app = module.exports = loopback(); -// boot scripts mount components like REST API +// Bootstrap the application, configure models, datasources and middleware. +// Sub-apps like REST API are mounted via boot scripts. boot(app, __dirname); -// -- Mount static files here-- -// All static middleware should be registered at the end, as all requests -// passing the static middleware are hitting the file system -// Example: -// var path = require('path'); -// app.middleware('files', loopback.static( -// path.resolve(__dirname, '../client'))); - app.start = function() { // start the web server return app.listen(function() {