11
SOGANG UNIVERSITY COMPUTER SCIENCE & ENGINEERING TEAM FULL STACK - KWAKJAEHOON VER 0.4 Node.js all in one

node.js All in one

Embed Size (px)

Citation preview

Page 1: node.js All in one

SOGANG UNIVERSITY COMPUTER SCIENCE & ENGINEER-ING TEAM FULL STACK - KWAKJAEHOON

VER 0.4

Node.js all in one

Page 2: node.js All in one

1. NODE.JS Download & Install Node.js at nodejs.org. Now what? Just do type code and run! (next

page)

Page 3: node.js All in one

2. JUST FOLLOW THIS – HELLO WORLD1. Make .js file (Just type with notepad and store this

with different name that .js)Make it sure that file name can’t be node.js!!(error)

2. Next just type following next paragraphs.

3. How to run? With node.js command prompt!You need file location information to run.

Page 4: node.js All in one

2. JUST FOLLOW THIS – HELLO WORLD Check .js location and approach to this loca-

tion in node.js command prompt.

Now Server is running!! Check it with connecting http://localhost:8000/

Page 5: node.js All in one

2. JUST FOLLOW THIS – HELLO WORLD Fantastic result, very simple and easy!!

Now you can do anything with Googling!!Google is my second brain… (actually first…)

From next slide, introduce my project using node.js

Page 6: node.js All in one

3. LOG SEARCH PROJECT Whole code : www.github.com/kwakjaehoon

First, look into auto.sh file. In this file, commands are listed. You need to in-stall npms, and if you need save those with --save

What is npm?? - npm makes it easy for JavaScript developers to share and reuse code, and it makes it easy to update the code that you're sharing.

Page 7: node.js All in one

3. LOG SEARCH PROJECT

With my code you can get a insight to node.js if you just follow my code from 1 line to end line.

If you have any question in it, just google it!!

Page 8: node.js All in one

4. WEATHER FORECAST PROJECT Source code at https://

github.com/xptr33/CAPSTONE_PRJ2_FORECAST

How we implemented this project using nodejs?

In this project, node.js functions in three ways: Node.js works as a web server using ‘ex-

press’ module. Node.js retrieves necessary weather forecast

data from kma.go.kr using ‘request’ module. Node.js pushes/pulls weather data onto/from

database using ‘mysql’ module.

Page 9: node.js All in one

4. WEATHER FORECAST PROJECT

Web browser(client)

Web server(server on node.js)

MYSQL Database

kma.go.kr(weather service)

Sends weather data to clients

(1) Pushes weather data onto database

Retrieves weather data periodically (approx. 1 hour)

Conceptual View

(2) Pulls weather data from database when there is any request from clients

Page 10: node.js All in one

4. WEATHER FORECAST PROJECT

Web browser(client)

– chart.html

Web server(server on node.js)

MYSQL Database

kma.go.kr(weather service)

server.js – ex-press module collect.js – request, xml

module (xml module re-quired to parse xml-for-mat weather data.)

Technical View

db.js / insert.js – mysql mod-ule

Page 11: node.js All in one

To be filled soon