Download free for 30 days
Sign in
Upload
Language (EN)
Support
Business
Mobile
Social Media
Marketing
Technology
Art & Photos
Career
Design
Education
Presentations & Public Speaking
Government & Nonprofit
Healthcare
Internet
Law
Leadership & Management
Automotive
Engineering
Software
Recruiting & HR
Retail
Sales
Services
Science
Small Business & Entrepreneurship
Food
Environment
Economy & Finance
Data & Analytics
Investor Relations
Sports
Spiritual
News & Politics
Travel
Self Improvement
Real Estate
Entertainment & Humor
Health & Medicine
Devices & Hardware
Lifestyle
Change Language
Language
English
Español
Português
Français
Deutsche
Cancel
Save
Submit search
EN
Uploaded by
Krasimir Tsonev
680 views
Using Node.js for everything or what it is to write a book about it
A presentation made at RigaDevDay (http://rigadevday.lv/)
Software
◦
Read more
1
Save
Share
Embed
Embed presentation
Download
Downloaded 10 times
1
/ 40
2
/ 40
3
/ 40
4
/ 40
5
/ 40
6
/ 40
7
/ 40
8
/ 40
9
/ 40
10
/ 40
11
/ 40
12
/ 40
13
/ 40
14
/ 40
15
/ 40
16
/ 40
17
/ 40
18
/ 40
19
/ 40
20
/ 40
21
/ 40
22
/ 40
23
/ 40
24
/ 40
25
/ 40
26
/ 40
27
/ 40
28
/ 40
29
/ 40
30
/ 40
31
/ 40
32
/ 40
33
/ 40
34
/ 40
35
/ 40
36
/ 40
37
/ 40
38
/ 40
39
/ 40
40
/ 40
More Related Content
PDF
Progressive Mobile Web Apps
by
dynamis
PDF
Modern Mobile Web Apps
by
dynamis
PDF
Java script.trend(spec)
by
dynamis
PDF
MySQLオンラインマイグレーションツールgh-ostで深夜メンテナンスを無くした話
by
Shuto Suzuki
PDF
商派信息安全解决方案
by
wanglei999
TXT
Hello world
by
Nagarajan S
PDF
Task Automatisierung mit Grunt.js
by
3rfan
TXT
Config
by
guest4f11e4
Progressive Mobile Web Apps
by
dynamis
Modern Mobile Web Apps
by
dynamis
Java script.trend(spec)
by
dynamis
MySQLオンラインマイグレーションツールgh-ostで深夜メンテナンスを無くした話
by
Shuto Suzuki
商派信息安全解决方案
by
wanglei999
Hello world
by
Nagarajan S
Task Automatisierung mit Grunt.js
by
3rfan
Config
by
guest4f11e4
Viewers also liked
PDF
Reactjs - the good, the bad and the ugly
by
Krasimir Tsonev
ZIP
Javascript Everywhere From Nose To Tail
by
Cliffano Subagio
KEY
5 Tips for Writing Better JavaScript
by
Nael El Shawwa
PDF
Developing large scale JavaScript applications
by
Milan Korsos
PDF
jQquerysummit - Large-scale JavaScript Application Architecture
by
Jiby John
PPTX
Unidirectional data flow
by
Denis Gorbunov
PDF
Modern Web Applications
by
Ömer Göktuğ Poyraz
Reactjs - the good, the bad and the ugly
by
Krasimir Tsonev
Javascript Everywhere From Nose To Tail
by
Cliffano Subagio
5 Tips for Writing Better JavaScript
by
Nael El Shawwa
Developing large scale JavaScript applications
by
Milan Korsos
jQquerysummit - Large-scale JavaScript Application Architecture
by
Jiby John
Unidirectional data flow
by
Denis Gorbunov
Modern Web Applications
by
Ömer Göktuğ Poyraz
Using Node.js for everything or what it is to write a book about it
8.
// lib/awesome.js module.exports =
function() { // ... our logic here } // app.js var awesome = require('./lib/awesome');
11.
//package.json { "name":"project-name", "version":"0.1.7", "description":"...", "dependencies":{ "other-module":"1.1.0" } } //terminal npmpublish //terminal npminstallproject-name
14.
var http =
require('http'); var server = http.createServer(function (req, res) { res.writeHead(200, {'Content-Type': 'text/plain'}); res.end('Hello Worldn'); }); server.listen(5060, '127.0.0.1');
16.
varfs=require('fs'),http=require('http'); varhtml=fs.readFileSync('path/to/my/file.html'); varcss=... varserver=http.createServer(function(req,res){ varextension=... switch(extension){ case"css":contentType="text/css";break; case"html":contentType="text/html";break; case"js":contentType="application/javascript";break; case"ico":contentType="image/ico";break; default:contentType="text/plain"; } res.writeHead(200,{'Content-Type':contentType}); res.end(content+'n'); }); server.listen(5060,'127.0.0.1');
18.
varhttp=require('http'); http.createServer(function(req,res){ if(req.url==='/api'){ res.writeHead(200,{'Content-Type':'application/json'}); switch(req.method){ case'GET':res.end('{"get":"OK"}');break; case'POST':res.end('{"post":"OK"}');break; case'PUT':res.end('{"put":"OK"}');break; case'DELETE':res.end('{"delete":"OK"}');break; } }else{ res.writeHead(200,{'Content-Type':'text/plain'}); res.end('<html><body>...n'); } }).listen(5060,'127.0.0.1'); console.log('Serverrunningathttp://127.0.0.1:5060/');
22.
// gulpfile.js var gulp
= require('gulp'); var concat = require('gulp-concat'); gulp.task('scripts', function() { gulp.src('./lib/*.js') .pipe(concat('all.js')) .pipe(gulp.dest('./dist/')) }); // terminal gulp scripts
23.
//Gruntfile.js module.exports=function(grunt){ grunt.initConfig({ concat:{ javascript:{ options:{}, src:['./lib/*.js'], dest:'build/scripts.js' } } }); grunt.loadNpmTasks('grunt-contrib-concat'); grunt.registerTask('default',['concat']); } //terminal grunt
30.
describe("TestingTODOMVC",function(){ before(function(){ app.todos.reset(); }); it("AddingnewTODOs",function(){ //...dosomething expect($('#todo-listli').length).to.be.equal(2); }); });
36.
//server vario=require('socket.io')(http); io.on('connection',function(socket){ socket.on('message-type',function(msg){ socket.emit('message-received','OK'); }); }); //browser //<scriptsrc="/socket.io/socket.io.js"></script> varsocket=io(); socket.emit('message-type','Helloworld!');
Download