SlideShare una empresa de Scribd logo
Código de lado servidor con Javascript y mucho más.
   Node.js es un entorno de programación
    en la capa del servidor basado en
    Javascript, con E/S de datos desde una
    arquitectura orientada a eventos y basado
    en el motor Javascript V8.

   V8 es un interprete, compilador y ejecutor
    de código Javascript.
   “Node.js es muchas cosas, pero en
    esencia es una forma de ejecutar
    JavaScript fuera del navegador web” –
    Ryan Dahl – 2009.

   Node.js le permite a JavaScript ser
    aplicado en muchos contextos más, en
    particular en los servidores web.
   JavaScript es un lenguaje orientado a
    eventos y node utiliza esta característica
    para producir servidores altamente
    escalables.

   Con una arquitectura llamada “bucles de
    eventos”, hace que la programación del
    servidor node sea altamente escalable y a
    su vez fácil y segura.
   Node.js incorpora varios "módulos básicos"
    compilados en binario, como por ejemplo el
    módulo Net, que proporciona una capa para
    programación de red asíncrona y otros
    módulos fundamentales, como por ejemplo
    Path, FileSystem, Buffer, Timers, y el de
    propósito más general Stream.
Dentro de la carpeta nodejs crearemos la carpeta htdocs, dentro de ella
  crearemos nuestro Script para montar un servidor web.


var http = require('http'); //importamos el modulo "http"
http.createServer(function (req, res) { // creamos un servidor
 res.writeHead(200, {'Content-Type': 'text/plain'}); //escribimos la cabecera de
   nuestro documento
 res.end('Bienvenido coneccion #‟ +req.socket.server._connections+‟n'); //
   enviamos un texto como salida
}).listen(80, „localhost'); // el servidor comienza a escuchar las peticiones
// que se le hagan desde la siguiente dirección: http://localhost
console.log('Servidor corriendo en http://localhost:80/');
   NPM (node package manager)
   REPL (Read–eval–print loop)
   CommonJS
   V8 JavaScript Engine(C++)
   ECMAScript: es un lenguaje de script
   ExpressJS
   Socket.IO
   Stylus
   Jade
   Síncrono:
   var result = db.query(‘select * from usuario’);
   // use result

   Asíncrono:
   db.query(‘select * from usuario’, function(result){
   // use result
   });
   HTTP: es half-duplex (su tráfico fluye en una
    sola dirección a la vez).(Nextel)

   WebSocket: es una tecnología web que
    establece canales de comunicacion bi-
    direccional(full-duplex) usando una simple
    conexión TCP.
   Real-Time
   Apps Escalables
   APIs JSON REST
   Streaming
   Bomber
Introduccion a Nodejs

Más contenido relacionado

La actualidad más candente

React Native Workshop
React Native WorkshopReact Native Workshop
React Native Workshop
Amazon Web Services
 
Express js
Express jsExpress js
Express js
Manav Prasad
 
Nest.js Introduction
Nest.js IntroductionNest.js Introduction
Nest.js Introduction
Takuya Tejima
 
Open infradays 2019_msa_k8s
Open infradays 2019_msa_k8sOpen infradays 2019_msa_k8s
Open infradays 2019_msa_k8s
Hyoungjun Kim
 
Introduction Node.js
Introduction Node.jsIntroduction Node.js
Introduction Node.js
Erik van Appeldoorn
 
Spring Security 5
Spring Security 5Spring Security 5
Spring Security 5
Jesus Perez Franco
 
1.suryo_atmojo-materi react-native 1 (mengenal react-native)
1.suryo_atmojo-materi react-native 1 (mengenal react-native)1.suryo_atmojo-materi react-native 1 (mengenal react-native)
1.suryo_atmojo-materi react-native 1 (mengenal react-native)
Suryo Atmojo
 
Apache TomEE - Tomcat with a kick
Apache TomEE  - Tomcat with a kickApache TomEE  - Tomcat with a kick
Apache TomEE - Tomcat with a kick
Vishwanath Krishnamurthi
 
JSON Web Tokens
JSON Web TokensJSON Web Tokens
JSON Web Tokens
Ivan Rosolen
 
React Native - Getting Started
React Native - Getting StartedReact Native - Getting Started
React Native - Getting Started
Tracy Lee
 
Rest web services
Rest web servicesRest web services
Rest web services
Paulo Gandra de Sousa
 
Introduction to Spring Boot
Introduction to Spring BootIntroduction to Spring Boot
Introduction to Spring Boot
Purbarun Chakrabarti
 
Rest API with Swagger and NodeJS
Rest API with Swagger and NodeJSRest API with Swagger and NodeJS
Rest API with Swagger and NodeJS
Luigi Saetta
 
REST APIs with Spring
REST APIs with SpringREST APIs with Spring
REST APIs with Spring
Joshua Long
 
Introducción a NodeJS
Introducción a NodeJSIntroducción a NodeJS
Introducción a NodeJS
BEEVA_es
 
Node js Introduction
Node js IntroductionNode js Introduction
Node js Introduction
sanskriti agarwal
 
Nuxt.js - Introduction
Nuxt.js - IntroductionNuxt.js - Introduction
Nuxt.js - Introduction
Sébastien Chopin
 
Apache web service
Apache web serviceApache web service
Apache web service
Manash Kumar Mondal
 
Introducing Swagger
Introducing SwaggerIntroducing Swagger
Introducing Swagger
Tony Tam
 
REST & API Management with the WSO2 ESB
REST & API Management with the WSO2 ESBREST & API Management with the WSO2 ESB
REST & API Management with the WSO2 ESBWSO2
 

La actualidad más candente (20)

React Native Workshop
React Native WorkshopReact Native Workshop
React Native Workshop
 
Express js
Express jsExpress js
Express js
 
Nest.js Introduction
Nest.js IntroductionNest.js Introduction
Nest.js Introduction
 
Open infradays 2019_msa_k8s
Open infradays 2019_msa_k8sOpen infradays 2019_msa_k8s
Open infradays 2019_msa_k8s
 
Introduction Node.js
Introduction Node.jsIntroduction Node.js
Introduction Node.js
 
Spring Security 5
Spring Security 5Spring Security 5
Spring Security 5
 
1.suryo_atmojo-materi react-native 1 (mengenal react-native)
1.suryo_atmojo-materi react-native 1 (mengenal react-native)1.suryo_atmojo-materi react-native 1 (mengenal react-native)
1.suryo_atmojo-materi react-native 1 (mengenal react-native)
 
Apache TomEE - Tomcat with a kick
Apache TomEE  - Tomcat with a kickApache TomEE  - Tomcat with a kick
Apache TomEE - Tomcat with a kick
 
JSON Web Tokens
JSON Web TokensJSON Web Tokens
JSON Web Tokens
 
React Native - Getting Started
React Native - Getting StartedReact Native - Getting Started
React Native - Getting Started
 
Rest web services
Rest web servicesRest web services
Rest web services
 
Introduction to Spring Boot
Introduction to Spring BootIntroduction to Spring Boot
Introduction to Spring Boot
 
Rest API with Swagger and NodeJS
Rest API with Swagger and NodeJSRest API with Swagger and NodeJS
Rest API with Swagger and NodeJS
 
REST APIs with Spring
REST APIs with SpringREST APIs with Spring
REST APIs with Spring
 
Introducción a NodeJS
Introducción a NodeJSIntroducción a NodeJS
Introducción a NodeJS
 
Node js Introduction
Node js IntroductionNode js Introduction
Node js Introduction
 
Nuxt.js - Introduction
Nuxt.js - IntroductionNuxt.js - Introduction
Nuxt.js - Introduction
 
Apache web service
Apache web serviceApache web service
Apache web service
 
Introducing Swagger
Introducing SwaggerIntroducing Swagger
Introducing Swagger
 
REST & API Management with the WSO2 ESB
REST & API Management with the WSO2 ESBREST & API Management with the WSO2 ESB
REST & API Management with the WSO2 ESB
 

Destacado

Introduccion a Node.js
Introduccion a Node.jsIntroduccion a Node.js
Introduccion a Node.js
Oscar Gensollen
 
Node JS (Francisco Cerdas)
Node JS (Francisco Cerdas)Node JS (Francisco Cerdas)
Node JS (Francisco Cerdas)
PiXeL16
 
Introducción a Node.js
Introducción a Node.jsIntroducción a Node.js
Introducción a Node.js
José Ignacio Fernández
 
Riesgos Laborales
Riesgos LaboralesRiesgos Laborales
Riesgos Laborales
TONY JOVO
 
Riviera del Conero e Colli dell'Infinito - Marche - Italy - 2016
Riviera del Conero e Colli dell'Infinito - Marche - Italy - 2016Riviera del Conero e Colli dell'Infinito - Marche - Italy - 2016
Riviera del Conero e Colli dell'Infinito - Marche - Italy - 2016
Riviera del Conero Tourism
 
BIMA Evening Briefing | Nice Agency - Retaining users on mobile.
BIMA Evening Briefing | Nice Agency - Retaining users on mobile.BIMA Evening Briefing | Nice Agency - Retaining users on mobile.
BIMA Evening Briefing | Nice Agency - Retaining users on mobile.
BIMA (British Interactive Media Association)
 
Presentación sector automoción Chequia y Eslovaquia
Presentación sector automoción Chequia y EslovaquiaPresentación sector automoción Chequia y Eslovaquia
Presentación sector automoción Chequia y Eslovaquia
Cadex Comercio Internacional, S.L.
 
PresentacióN Murgiverde 10 11 EspañOl Francisco Javier
PresentacióN Murgiverde 10 11 EspañOl Francisco JavierPresentacióN Murgiverde 10 11 EspañOl Francisco Javier
PresentacióN Murgiverde 10 11 EspañOl Francisco Javier
freelance comercio internacional
 
Valoraciones y análisis sobre el derecho de superficie en el código civil per...
Valoraciones y análisis sobre el derecho de superficie en el código civil per...Valoraciones y análisis sobre el derecho de superficie en el código civil per...
Valoraciones y análisis sobre el derecho de superficie en el código civil per...
Neomar Huarca Taype
 
Turn Up for Your HBCU: Part II
Turn Up for Your HBCU: Part IITurn Up for Your HBCU: Part II
Turn Up for Your HBCU: Part II
Ebonie Cooper
 
Misterios d excel pre
Misterios d excel preMisterios d excel pre
Misterios d excel prejtk1
 
Ilian Uzunov (Georgi Georgiev): Ilian Uzunov (Georgi Georgiev)
Ilian Uzunov (Georgi Georgiev): Ilian Uzunov (Georgi Georgiev)Ilian Uzunov (Georgi Georgiev): Ilian Uzunov (Georgi Georgiev)
Ilian Uzunov (Georgi Georgiev): Ilian Uzunov (Georgi Georgiev)
Semantic Web Company
 
Better serving members using one social spot
Better serving members using one social spotBetter serving members using one social spot
Better serving members using one social spot
Microsoft
 
Announcements 01.04.15
Announcements 01.04.15Announcements 01.04.15
Announcements 01.04.15
Roger Scantlin
 
08. Minitaller: el diseño de tu empresa para el mundo - Andrea Caruso
08. Minitaller: el diseño de tu empresa para el mundo - Andrea Caruso08. Minitaller: el diseño de tu empresa para el mundo - Andrea Caruso
08. Minitaller: el diseño de tu empresa para el mundo - Andrea Caruso
EOI Escuela de Organización Industrial
 
Enterprise Sales Training Week
Enterprise Sales Training WeekEnterprise Sales Training Week
Enterprise Sales Training Week
Kristen Tadrous
 

Destacado (20)

Expo node js
Expo node jsExpo node js
Expo node js
 
Introduccion a Node.js
Introduccion a Node.jsIntroduccion a Node.js
Introduccion a Node.js
 
Node JS (Francisco Cerdas)
Node JS (Francisco Cerdas)Node JS (Francisco Cerdas)
Node JS (Francisco Cerdas)
 
Introducción a Node.js
Introducción a Node.jsIntroducción a Node.js
Introducción a Node.js
 
Riesgos Laborales
Riesgos LaboralesRiesgos Laborales
Riesgos Laborales
 
Riviera del Conero e Colli dell'Infinito - Marche - Italy - 2016
Riviera del Conero e Colli dell'Infinito - Marche - Italy - 2016Riviera del Conero e Colli dell'Infinito - Marche - Italy - 2016
Riviera del Conero e Colli dell'Infinito - Marche - Italy - 2016
 
BIMA Evening Briefing | Nice Agency - Retaining users on mobile.
BIMA Evening Briefing | Nice Agency - Retaining users on mobile.BIMA Evening Briefing | Nice Agency - Retaining users on mobile.
BIMA Evening Briefing | Nice Agency - Retaining users on mobile.
 
Presentación sector automoción Chequia y Eslovaquia
Presentación sector automoción Chequia y EslovaquiaPresentación sector automoción Chequia y Eslovaquia
Presentación sector automoción Chequia y Eslovaquia
 
Nathan Purser CV
Nathan Purser CVNathan Purser CV
Nathan Purser CV
 
PresentacióN Murgiverde 10 11 EspañOl Francisco Javier
PresentacióN Murgiverde 10 11 EspañOl Francisco JavierPresentacióN Murgiverde 10 11 EspañOl Francisco Javier
PresentacióN Murgiverde 10 11 EspañOl Francisco Javier
 
WCC Best Practices
WCC Best PracticesWCC Best Practices
WCC Best Practices
 
Valoraciones y análisis sobre el derecho de superficie en el código civil per...
Valoraciones y análisis sobre el derecho de superficie en el código civil per...Valoraciones y análisis sobre el derecho de superficie en el código civil per...
Valoraciones y análisis sobre el derecho de superficie en el código civil per...
 
Turn Up for Your HBCU: Part II
Turn Up for Your HBCU: Part IITurn Up for Your HBCU: Part II
Turn Up for Your HBCU: Part II
 
Misterios d excel pre
Misterios d excel preMisterios d excel pre
Misterios d excel pre
 
Ilian Uzunov (Georgi Georgiev): Ilian Uzunov (Georgi Georgiev)
Ilian Uzunov (Georgi Georgiev): Ilian Uzunov (Georgi Georgiev)Ilian Uzunov (Georgi Georgiev): Ilian Uzunov (Georgi Georgiev)
Ilian Uzunov (Georgi Georgiev): Ilian Uzunov (Georgi Georgiev)
 
Better serving members using one social spot
Better serving members using one social spotBetter serving members using one social spot
Better serving members using one social spot
 
Announcements 01.04.15
Announcements 01.04.15Announcements 01.04.15
Announcements 01.04.15
 
08. Minitaller: el diseño de tu empresa para el mundo - Andrea Caruso
08. Minitaller: el diseño de tu empresa para el mundo - Andrea Caruso08. Minitaller: el diseño de tu empresa para el mundo - Andrea Caruso
08. Minitaller: el diseño de tu empresa para el mundo - Andrea Caruso
 
Enterprise Sales Training Week
Enterprise Sales Training WeekEnterprise Sales Training Week
Enterprise Sales Training Week
 
Rm579 2010-minsa
Rm579 2010-minsaRm579 2010-minsa
Rm579 2010-minsa
 

Similar a Introduccion a Nodejs

Node.js - un poco de informacion.
Node.js - un poco de informacion.Node.js - un poco de informacion.
Node.js - un poco de informacion.Luis Toscano
 
Sistemas Distribuidos basados en la Web
Sistemas Distribuidos basados en la WebSistemas Distribuidos basados en la Web
Sistemas Distribuidos basados en la Web
Tensor
 
Clase17(introduccion a la web)
Clase17(introduccion a la web)Clase17(introduccion a la web)
Clase17(introduccion a la web)
Tensor
 
Servicio apache gnu linux-centos ::: http://leymebamba.com
Servicio apache  gnu linux-centos  ::: http://leymebamba.comServicio apache  gnu linux-centos  ::: http://leymebamba.com
Servicio apache gnu linux-centos ::: http://leymebamba.com
{|::::::. ELDAVAN .:::::::|}
 
Servicios web java php-perl-google
Servicios web java php-perl-googleServicios web java php-perl-google
Servicios web java php-perl-googleJosue Hernandez
 
Web centos
Web centosWeb centos
Web centosjessidi
 
Servlet
ServletServlet
Servlet
spcsliki62
 
Framework Catalyst
Framework CatalystFramework Catalyst
Framework Catalyst
Eduardo Rafael Petla
 
Curso de php
Curso de phpCurso de php
Aspectos nodejs
Aspectos nodejsAspectos nodejs
24. Introducción a Node JS.pdf
24. Introducción a Node JS.pdf24. Introducción a Node JS.pdf
24. Introducción a Node JS.pdf
mabytax
 

Similar a Introduccion a Nodejs (20)

Servicios web
Servicios webServicios web
Servicios web
 
Servicios web
Servicios webServicios web
Servicios web
 
Servicios web
Servicios webServicios web
Servicios web
 
Node.js - un poco de informacion.
Node.js - un poco de informacion.Node.js - un poco de informacion.
Node.js - un poco de informacion.
 
Sistemas Distribuidos basados en la Web
Sistemas Distribuidos basados en la WebSistemas Distribuidos basados en la Web
Sistemas Distribuidos basados en la Web
 
Clase17(introduccion a la web)
Clase17(introduccion a la web)Clase17(introduccion a la web)
Clase17(introduccion a la web)
 
Servidor web
Servidor webServidor web
Servidor web
 
Servicio apache gnu linux-centos ::: http://leymebamba.com
Servicio apache  gnu linux-centos  ::: http://leymebamba.comServicio apache  gnu linux-centos  ::: http://leymebamba.com
Servicio apache gnu linux-centos ::: http://leymebamba.com
 
Servicios web java php-perl-google
Servicios web java php-perl-googleServicios web java php-perl-google
Servicios web java php-perl-google
 
Unidad 2
Unidad 2Unidad 2
Unidad 2
 
Servidor web
Servidor webServidor web
Servidor web
 
Web centos
Web centosWeb centos
Web centos
 
Servlet
ServletServlet
Servlet
 
Framework Catalyst
Framework CatalystFramework Catalyst
Framework Catalyst
 
Curso de php
Curso de phpCurso de php
Curso de php
 
Aspectos nodejs
Aspectos nodejsAspectos nodejs
Aspectos nodejs
 
Servicios web Extendido_error perl
Servicios web Extendido_error perlServicios web Extendido_error perl
Servicios web Extendido_error perl
 
Unidad_2
Unidad_2Unidad_2
Unidad_2
 
Apli t1 ejr
Apli t1 ejrApli t1 ejr
Apli t1 ejr
 
24. Introducción a Node JS.pdf
24. Introducción a Node JS.pdf24. Introducción a Node JS.pdf
24. Introducción a Node JS.pdf
 

Introduccion a Nodejs

  • 1. Código de lado servidor con Javascript y mucho más.
  • 2. Node.js es un entorno de programación en la capa del servidor basado en Javascript, con E/S de datos desde una arquitectura orientada a eventos y basado en el motor Javascript V8.  V8 es un interprete, compilador y ejecutor de código Javascript.
  • 3. “Node.js es muchas cosas, pero en esencia es una forma de ejecutar JavaScript fuera del navegador web” – Ryan Dahl – 2009.  Node.js le permite a JavaScript ser aplicado en muchos contextos más, en particular en los servidores web.
  • 4. JavaScript es un lenguaje orientado a eventos y node utiliza esta característica para producir servidores altamente escalables.  Con una arquitectura llamada “bucles de eventos”, hace que la programación del servidor node sea altamente escalable y a su vez fácil y segura.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9. Node.js incorpora varios "módulos básicos" compilados en binario, como por ejemplo el módulo Net, que proporciona una capa para programación de red asíncrona y otros módulos fundamentales, como por ejemplo Path, FileSystem, Buffer, Timers, y el de propósito más general Stream.
  • 10.
  • 11. Dentro de la carpeta nodejs crearemos la carpeta htdocs, dentro de ella crearemos nuestro Script para montar un servidor web. var http = require('http'); //importamos el modulo "http" http.createServer(function (req, res) { // creamos un servidor res.writeHead(200, {'Content-Type': 'text/plain'}); //escribimos la cabecera de nuestro documento res.end('Bienvenido coneccion #‟ +req.socket.server._connections+‟n'); // enviamos un texto como salida }).listen(80, „localhost'); // el servidor comienza a escuchar las peticiones // que se le hagan desde la siguiente dirección: http://localhost console.log('Servidor corriendo en http://localhost:80/');
  • 12. NPM (node package manager)  REPL (Read–eval–print loop)  CommonJS  V8 JavaScript Engine(C++)  ECMAScript: es un lenguaje de script  ExpressJS  Socket.IO  Stylus  Jade
  • 13. Síncrono:  var result = db.query(‘select * from usuario’);  // use result  Asíncrono:  db.query(‘select * from usuario’, function(result){  // use result  });
  • 14. HTTP: es half-duplex (su tráfico fluye en una sola dirección a la vez).(Nextel)  WebSocket: es una tecnología web que establece canales de comunicacion bi- direccional(full-duplex) usando una simple conexión TCP.
  • 15. Real-Time  Apps Escalables  APIs JSON REST  Streaming
  • 16. Bomber