This repository was archived by the owner on Jan 18, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgetting-started.html
More file actions
206 lines (146 loc) · 4.47 KB
/
getting-started.html
File metadata and controls
206 lines (146 loc) · 4.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<title>Getting Started</title>
<script type="text/javascript" src="/thirdparty/prettify/prettify.js"></script>
<script type="text/javascript" src="/thirdparty/jquery-1.5.1.min.js"></script>
<script type="text/javascript" src="/site.js"></script>
<link rel="stylesheet" type="text/css" href="/style/pages.css" />
<link rel="stylesheet" type="text/css" href="/thirdparty/prettify/prettify.css"/>
<!--[if IE 6]>
<style>.content { height: 100%;}</style>
<![endif]-->
</head>
<body class="">
<div class="section-title">
<a href="/">UseNode</a>
</div>
<ul class="quick-links">
<li>
<a href="/proton.html">Proton</a>
</li>
<li>
<a href="/micro.html">Micro</a>
</li>
<li>
<a href="/spectrum.html">Spectrum</a>
</li>
<li>
<a href="/litmus.html">Litmus</a>
</li>
</ul>
<div class="page">
<div class="page-inner">
<div class="column">
<ul class="navigation local-navigation">
<li>
<a href="/">Home</a>
</li>
<li>
<a href="/getting-started/what-does-what.html">What does what</a>
</li>
<li>
<a href="/proton.html">Proton</a>
</li>
<li>
<a href="/micro.html">Micro</a>
</li>
<li>
<a href="/spectrum.html">Spectrum</a>
</li>
<li>
<a href="/contact.html">Contact</a>
</li>
</ul>
</div>
<div class="column content">
<h1>Getting started</h1>
<p>
To make it easier to build websites for <a href="">Node.js</a>, we've created a set of minimal libraries to get you going.
</p>
<p>
All you need to get started is access to <code>node</code> and can install packages with <a href="http://npmjs.org/">npm</a>.
</p>
<pre><code>npm -g install proton micro
</code></pre>
<p>
Create <code>lib/webapp.js</code> and add the following code:
</p>
<pre><code>var micro = require('micro'),
WebApp = exports.WebApp = micro.webapp(),
get = WebApp.get;
get('/', function (request, response) {
response.ok('text/html');
return 'hello, world';
});
</code></pre>
<p>
Now run your app with <a href="">Proton</a>.
</p>
<pre><code>proton -r</code></pre>
<p>
You can now visit <a href="http://localhost:8080/">http://localhost:8080/</a> in your browser to see the text "hello, world".
</p>
<p>
The <code>-r</code> argument means that changes you make to your webapp will be automatically reloaded, making <a href="/proton/cli#development">development faster</a>.
</p>
<h2>Right, what next?</h2>
<ul>
<!--
WIP
<li>
See a <a href="/getting-started/building-a-todo-list-app.html">more in-depth example</a>.
</li>
-->
<li>
Try some fancier <a href="/micro/routes.html">URL matching</a>.
</li>
<li>
Create HTML templates with <a href="/spectrum/using-spectrum-with-micro.html">Spectrum</a>.
</li>
<li>
Start <a href="/litmus.html">writing unit tests with Litmus</a>.
</li>
<li>
Have a look at <a href="/getting-started/what-does-what.html">what we offer</a>.
</li>
<!--
<li>
Set up simple <a href="/micro/guides/static-asset-handling">static asset handling</a>.
</li>
-->
</ul>
</div>
</div>
</div>
<div class="site">
<div class="site-logo">
<a href="/">use.no.de</a>
</div>
<ul class="global-navigation">
<li>
<a href="/proton.html">Proton</a>
</li>
<li>
<a href="/micro.html">Micro</a>
</li>
<li>
<a href="/spectrum.html">Spectrum</a>
</li>
<li>
<a href="/swipe.html">Swipe</a>
</li>
<li>
<a href="/litmus.html">Litmus</a>
</li>
<li>
<a href="/contact.html">Contact</a>
</li>
</ul>
<div class="copyright">
Site developed by <a href="http://github.com/tomyan">Tom Yandell</a> & <a href="http://www.twitter.com/richardhodgson">Richard Hodgson</a>.
</div>
</div>
</body>
</html>