Node.js ではじめてみるWeb開発

37
Node.js ででででででで Web でで Node.js ででででででで Web でででででででででででででででででででででででででで Coils work. | shuft で (@_shuft)

Transcript of Node.js ではじめてみるWeb開発

Node.jsWeb

Node.jsWebNode.jsWebCoils work. | shuft (@_shuft)

1

Coils Work. | Shuft (@_shuft)< />

Coils Work. | Shuft (@_shuft)< />

Coils Work. | Shuft (@_shuft)< ? />

4

Coils Work. | Shuft (@_shuft)< />

Shuft ( @_shuft )

2

: http://coils.work/

Coils Work. | Shuft (@_shuft)< About me />

Coils Work. | Shuft (@_shuft)< About me />

JK ( ) Coils Work. | Shuft (@_shuft)< ? />

Coils Work. | Shuft (@_shuft)< />

Coils Work. | Shuft (@_shuft)< />

https://mascot-apps-contest.azurewebsites.net

Coils Work. | Shuft (@_shuft)< />(Web)?

Coils Work. | Shuft (@_shuft)< />

(

Coils Work. | Shuft (@_shuft)< />

3!

13

Coils Work. | Shuft (@_shuft)< />

LINETwitterCoils Work. | Shuft (@_shuft)< ? />

Coils Work. | Shuft (@_shuft)< ? />

Coils Work. | Shuft (@_shuft)< />

Ruby on Rails (Proxy)PHP

Node.jsRuby on RailsNode.jsPHP

Y Nakanishi (YN) - JavaScriptGoogleV8 JavaScript EngineI/O(I/O)JavaScript

npm(Node Package Manager) : Mysql , Socket.io , Express , ejs , ect

Coils Work. | Shuft (@_shuft)< Node.js is />

OS : Windows : JavaScript ( Node.js ) ,TypeScript () , EJS , CSS : VisualStudio , Brackets , Atom : Git (Github) : MySQL (InnoDB) : Socket.io , jQuery , Bootstrap API

: MVC ( Model , View , Controller )Coils Work. | Shuft (@_shuft)< />

: design pattern

Coils Work. | Shuft (@_shuft)< ? />:https://ja.wikipedia.org/wiki/_()

MVC ( Model View Controller )

Model : Controller

View :

Controller : View/Model : http://doriven.hatenablog.com/entry/2014/11/01/032346Coils Work. | Shuft (@_shuft)< ? />MVCMVC2

MVCMVCMVC21

Coils Work. | Shuft (@_shuft)< ? />

Controller

Socket.io

Model

MySQL

View

WebBootstrap

Coils Work. | Shuft (@_shuft)< ? />

Web

:front-end:back-end : https://ja.wikipedia.org/wiki/

: ( Web ) : ( ) (Coils Work. | Shuft (@_shuft)< ?? />

VisualStudio : F5Ctrl+K,DCtrl+K,Cejs

Brackets : ejs

Coils Work. | Shuft (@_shuft)< />

Node.jsAbout

const http = require('http');

const hostname = '127.0.0.1';const port = 1337;

http.createServer((req, res) => { res.writeHead(200, { 'Content-Type': 'text/plain' }); res.end('Hello World\n');}).listen(port, hostname, () => { console.log(`Server running at http://${hostname}:${port}/`);});

(`)Coils Work. | Shuft (@_shuft)< />

Coils Work. | Shuft (@_shuft)< />

Coils Work. | Shuft (@_shuft)< />

Coils Work. | Shuft (@_shuft)< />

29

fs.readFile(. + req.url, binary, function (err, data) { res.writeHead(200, { Content-Type: GetcontentType }); res.end(data, binary); });Coils Work. | Shuft (@_shuft)< />TypeScript

Coils Work. | Shuft (@_shuft)< />

()

: Coils Work. | Shuft (@_shuft)< />

Google32

Coils Work. | Shuft (@_shuft)< />Socket.io

()

33

?Coils Work. | Shuft (@_shuft)< />

Coils Work. | Shuft (@_shuft)< /> ( 2 )1

35

RouterExpressRouter : URLURL : http://kosenconf.jp/100 : http://kosenconf.jp/?100tokyo

Express : npmWeb

Express

Socket.ioCoils Work. | Shuft (@_shuft)< />

RouterExpressRouterExpressnpm36

Web

Node.js()Express

Coils Work. | Shuft (@_shuft)< />

Coils Work. | Shuft (@_shuft)< />

Coils work. | shuft (@_shuft)

39