Created
May 1, 2017 10:09
-
-
Save gorkamu/3bb49127e635bfc502046e270127e1ac to your computer and use it in GitHub Desktop.
Core fle of out node.js app
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict' | |
var express = require('express'); | |
var bodyParser = require('body-parser'); | |
var app = express(); | |
var api = require('./routes/favorito'); | |
// Convierte una petición recibida (POST-GET...) a objeto JSON | |
app.use(bodyParser.urlencoded({extended:false})); | |
app.use(bodyParser.json()); | |
app.use('/api', api); | |
// Exportar la variable 'app' que contiene express para poder usarla-requerirla en otros ficheros | |
module.exports = app; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment