Skip to content

Instantly share code, notes, and snippets.

@ivanbtrujillo
Last active June 18, 2017 13:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ivanbtrujillo/3de8ffd2ae45d111a559e6fd4db26123 to your computer and use it in GitHub Desktop.
Save ivanbtrujillo/3de8ffd2ae45d111a559e6fd4db26123 to your computer and use it in GitHub Desktop.
GraphQL. 02 - Servidor en Node con Express - 01
// Importamos la librería express
const express = require('express');
// Creamos una aplicación express
const app = express();
/*
Indicamos que escuche en el puerto 4000 y ejecute una funcion callback la cual
mostrará un mensaje de error si lo hubiera, si sino mostrará el mensaje:
Servidor express funcionando en el puerto 4000
*/
app.listen(4000, (err, res) => {
if (err)
console.log(`Error: ${err}`);
else
console.log('Servidor express funcionando en el puerto 4000')
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment