salix/services/auth/server/server.js

33 lines
938 B
JavaScript
Raw Normal View History

2016-11-07 09:06:28 +00:00
'use strict';
var loopback = require('loopback');
var boot = require('loopback-boot');
2016-11-08 08:07:39 +00:00
var express=require('express');
var path = require('path');
2016-11-07 09:06:28 +00:00
var app = module.exports = loopback();
2016-11-08 08:07:39 +00:00
// modificado
app.set('view engine', 'ejs');
2017-05-05 10:54:47 +00:00
app.set('views', path.join(__dirname,'../client'));
2016-11-08 08:07:39 +00:00
app.use(loopback.static(path.resolve(__dirname, '../client')));
2017-05-05 10:54:47 +00:00
app.set('applications', require("./application.json"));
2016-11-08 08:07:39 +00:00
// fin
2016-11-07 09:06:28 +00:00
app.start = function() {
return app.listen(function() {
app.emit('started');
var baseUrl = app.get('url').replace(/\/$/, '');
2016-11-08 08:07:39 +00:00
console.log('Web server LOGIN listening at: %s', baseUrl);
2016-11-07 09:06:28 +00:00
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();
});