Skip to content

Commit

Permalink
documentacion
Browse files Browse the repository at this point in the history
  • Loading branch information
demiurgosoft committed May 4, 2016
1 parent 91374ee commit fd42b32
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 23 deletions.
21 changes: 9 additions & 12 deletions app/routes.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,25 +29,24 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.*/
// ### Dependencias locales

// * [**Rutas configurables**](./routes/routesConfig.html): Rutas genéricas de transparente.ugr
// * **Configuración**: Configuración del servidor
// * **Configuración de rutas específicas**
// * [**Index**](./routes/index.html): Ruta a página principal
// * [**Mapa Web**](./routes/mapaWeb.html): Ruta a mapa web
// * [**Calendario**](./routes/calendario.html): Ruta a calendario
// * [**Calendario Solo**](./routes/calendarioSolo.html): Ruta a calendario Solo (_Legacy_)
var routesList = require('./routes/routesConfig').routes;
var routesBusqueda = require('./routes/routesConfig').routesBusqueda;
// * **Configuración**: Configuración del servidor
var config = require('../config/config');

// * **Configuración de rutas específicas**
// * [**Index**](./routes/index.html): Ruta a página principal
var index = require('./routes/index');
// * [**Mapa Web**](./routes/mapaWeb.html): Ruta a mapa web
var mapaWeb = require('./routes/mapaWeb');
// * [**Calendario**](./routes/calendario.html): Ruta a calendario
var calendario = require('./routes/calendario');
// * [**Calendario Solo**](./routes/calendarioSolo.html): Ruta a calendario Solo (_Legacy_)
var calendarioSolo = require('./routes/calendarioSolo');

// ### Configuración de Rutas
// Asigna todas las rutas de transparente.ugr
module.exports = function(app) {
// función: Configura una ruta
function setRoute(routeConf) {
return function(req, res) {
res.render(routeConf.plantilla, {
Expand All @@ -64,16 +63,14 @@ module.exports = function(app) {

// #### Otras Rutas
// * Inicio: / y /index.html
// * Mapa del sitio: /mapaWeb.html
// * Calendario: /calendario.html y calendarioSolo.html
app.get('/', index.index);
app.get('/index.html', index.index);

// * Mapa del sitio: /mapaWeb.html
app.get('/mapaWeb.html', mapaWeb.mapaWeb);
// * Calendario: /calendario.html y calendarioSolo.html
app.get('/calendario.html', calendario.index);
app.get('/calendarioSolo.html', calendarioSolo.index);


// #### Rutas del buscador
function setRouteArchivos(routeConf) {
return function(req, res) {
Expand All @@ -85,7 +82,7 @@ module.exports = function(app) {
}

// #### Manejador de errores
// Devuelve un 404 wn caso de no enrutar correctamente
// Devuelve un 404 en caso de no enrutar correctamente
app.use(function(req, res, next) {
res.status(404).render('error_404', {
seccion: config.error.titulo,
Expand Down
16 changes: 12 additions & 4 deletions app/routes/routesConfig.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
"use strict";
// # Rutas Generales
/*
UGR Transparente. Sitio Web de la Universidad de Granada de acceso a Datos Abiertos.
Configuración general de rutas
*/

"use strict";
/*UGR Transparente. Sitio Web de la Universidad de Granada de acceso a Datos Abiertos.
Copyright (C) 2014 Jaime Torres Benavente, Óscar Zafra Megías
Copyright (C) 2015 Mario Heredia Moreno, Germán Martínez Maldonado
Copyright (C) 2016 Andrés Ortiz Corrales
Expand All @@ -18,11 +22,15 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
along with this program. If not, see <http://www.gnu.org/licenses/>.*/

var jsons = require('../../config/config').archivosJson;

// **exports**
// * routes: información de las rutas
// * routesBusqueda: información de las rutas del buscador


module.exports = {
routes: [{
url: "/personal.html",
Expand Down
14 changes: 7 additions & 7 deletions app/serverConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.*/

// ### Dependencias

//var debug = require('debug')('ugr-transparente-servidor:server');
// * **Serve Favicon:** Devuelve el favicon.ico
var favicon = require('serve-favicon');
//var logger = require('morgan');
// * **Express:** Middleware _static_ de express para servir archivos estáticos
var expressStatic = require('express').static;
// * **EJS Layouts:** Módulo para poder crear layouts con EJS
var favicon = require('serve-favicon');
var expressStatic = require('express').static;
var expressLayouts = require('express-ejs-layouts');
//var logger = require('morgan');
//var debug = require('debug')('ugr-transparente-servidor:server');

// #### Dependencias locales
// * **Configuración**: Configuración del servidor
Expand All @@ -47,10 +47,10 @@ var config = require('../config/config');
module.exports = function(app) {
// #### Variables de entorno
// * **PORT:** Puerto en el que ejecutar transparente
app.set('port', process.env.PORT || config.puerto);
// * **IP:** IP sobre la que ejecutar transparente (por defecto `127.0.0.1`)
app.set('ip', process.env.IP || "127.0.0.1");
// * **ENV:** Entorno de ejecución (`PROD` o `DEV`)
app.set('port', process.env.PORT || config.puerto);
app.set('ip', process.env.IP || "127.0.0.1");
app.set('env', process.env.ENV);

// ### Middlewares
Expand All @@ -72,4 +72,4 @@ module.exports = function(app) {
if (app.get('env') === "dev") {
app.use(expressStatic('./public'));
}
};
};

0 comments on commit fd42b32

Please sign in to comment.