Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
第五回後期ネットワークチーム講座
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
北海道科学大学 電子計算機研究部
November 21, 2016
Education
110
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
第五回後期ネットワークチーム講座
北海道科学大学 電子計算機研究部
November 21, 2016
Transcript
18 slides
ネットワークチーム 後期第五回講座資料 アプリケーション作成
目次 • アプリケーション作成 • 用語解説
準備 1. 作業用フォルダでコマンドプロンプトを開く 2. npm init を実行 (その後は特にこだわりがなければ全てEnterでよい)
package.json • npm init を実行すると package.json が作られる • JSONは、JavaScript のオブジェクトと同様の記法で書か
れたテキストファイル プログラムにデータを渡す際などに使用される
package.json の中身 → 入っていないモジュールがある 場合、以下を実行 npm install --save モジュール名
package.json • 内容を見ると、現在インストールしているモジュールが “dependencies :” に書き込まれている 新たにモジュールを追加する場合、インストール時に ”--save” オプションを使用する •
npm update で一括アップデート、npm start で実行 etc…
Pug(旧Jade)の記法 ①基本的にタグ名のみ記述 (<>いらず、閉じタグもなし) ② インデントを用いて階層構造を表現する ③タグ名の後に( )を付けて属性の指定ができる
Pug(Jade)の記法 ④ 簡単な制御構文(While, If など)や変数、JSコードが利用で きる JSのコードは先頭に” – “(ハイフン)を付けて記述する ⑤
変数を呼び出す場合、 #{変数名} または =変数名 と記述 ⑥ コマンドを用いることでテンプレートの継承ができる
• app.js を次の2ページの通り記述 一つのjsファイルに続けて書く (全28行)
None
None
• 次に、app.js があるフォルダ内に 「views」 というフォルダを作成 (ついでに 「public」 というフォルダも作成)
Pugファイル作成 • views/index.pug (全4行)
Pugファイル作成 • views/layout.pug (全10行)
CSS作成 • public/css/style.css
レンダリング • テンプレートエンジンからHTMLを生成すること • render関数でこれが行われている
レンダリング • render関数から渡された値はpugファイルで指定された場所に 代入される
ルーティング • リクエストされたURLに対して呼び出すアクションを変更する仕組 Localhost:3000/ にアクセスした場合 ↓ Localhost:3000/hello/ にアクセスした場合 ↓
More Decks by 北海道科学大学 電子計算機研究部
See All by 北海道科学大学 電子計算機研究部
第12回Network講座2019
densan
1
73
第11回Network講座2019
densan
0
88
第10回Network講座2019
densan
0
67
第09回Network講座2019
densan
1
190
第08回Network講座2019
densan
0
60
第07回Network講座2019
densan
0
65
第06回Network講座2019
densan
0
88
第05回Network講座2019
densan
0
64
第04回Network講座2019
densan
0
130
Other Decks in Education
See All in Education
Sekolah Sabat - Triwulan 4 2026 - Pelajaran 4
hiola
0
7.4k
【ainiチャット操作ガイド】
ainischool
0
210
Design Guidelines and Models - Lecture 5 - Human-Computer Interaction (1023841ANR)
signer
PRO
0
1.7k
HCI and Interaction Design - Lecture 2 - Human-Computer Interaction (1023841ANR)
signer
PRO
0
2k
2026年度秋学期 統計学 第4回 データを「分布」で見る (2026. 10. 20)
akiraasano
PRO
0
210
Sanapilvet opetuksessa
matleenalaakso
1
36k
Sekolah Sabat - Triwulan 4 2026 - Pelajaran 3
hiola
0
7.2k
Session 3 - Diplomasi
adeputra13
0
520
Concours Photo - UGE - 2026
echaille
0
180
Railsチュートリアル × 反転学習の事例紹介
yasslab
PRO
3
190k
[2026後期火5] 論理学(京都大学文学部 後期 第3回)「∀ の規則と固有変数条件」
yatabe
0
170
Biological Source, Chemical Constituents And Therapeutic Efficacy
pawan_pharm
0
170
Featured
See All Featured
Money Talks: Using Revenue to Get Sh*t Done
nikkihalliwell
0
560
Balancing Empowerment & Direction
lara
6
1.4k
Jamie Indigo - Trashchat’s Guide to Black Boxes: Technical SEO Tactics for LLMs
techseoconnect
PRO
0
750
Information Architects: The Missing Link in Design Systems
soysaucechin
1
1.3k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
128
56k
The Invisible Side of Design
smashingmag
301
52k
Collaborative Software Design: How to facilitate domain modelling decisions
baasie
1
380
Side Projects
sachag
456
43k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
254
23k
Become a Pro
speakerdeck
PRO
31
6.4k
The Power of CSS Pseudo Elements
geoffreycrofte
82
6.6k
Jess Joyce - The Pitfalls of Following Frameworks
techseoconnect
PRO
1
480