salix/services/auth/server/server.js

33 lines
938 B
JavaScript

'use strict';
var loopback = require('loopback');
var boot = require('loopback-boot');
var express=require('express');
var path = require('path');
var app = module.exports = loopback();
// modificado
app.set('view engine', 'ejs');
app.set('views', path.join(__dirname,'../client'));
app.use(loopback.static(path.resolve(__dirname, '../client')));
app.set('applications', require('./application.json'));
// fin
app.start = function() {
return app.listen(function() {
app.emit('started');
var baseUrl = app.get('url').replace(/\/$/, '');
console.log('Web server LOGIN listening at: %s', baseUrl);
if (app.get('loopback-component-explorer')) {
var explorerPath = app.get('loopback-component-explorer').mountPath;
console.log('Browse your REST API at %s%s', baseUrl, explorerPath);
}
});
};
boot(app, __dirname, function(err) {
if (err) throw err;
if (require.main === module)
app.start();
});