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 pathmicro.html
More file actions
185 lines (115 loc) · 4.19 KB
/
micro.html
File metadata and controls
185 lines (115 loc) · 4.19 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
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<title>Micro</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="/micro.html">Micro</a>
</div>
<ul class="quick-links">
<li>
<a href="/proton.html">Proton</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 class="selected">
<a href="/micro.html">Home</a>
</li>
<li>
<a href="/micro/getting-started.html">Getting Started</a>
</li>
<li>
<a href="/micro/routes.html">Routes</a>
</li>
</ul>
</div>
<div class="column content">
<p>
Micro.js is a micro webapp framework along the same lines as <a href="http://www.sinatrarb.com/">Sinatra</a>, running on top of <a href="https://github.com/usenode/proton.js">Proton.js</a>, and hence <a href="http://wiki.commonjs.org/wiki/JSGI/Level0/A/Draft2">JSGI</a> (using <a href="https://github.com/kriszyp/jsgi-node">jsgi-node</a>) and <a href="http://nodejs.org/">Node.js</a> (although there is no reason it couldn't be made to work in other <a href="http://www.commonjs.org/">CommonJS</a> environments).
</p>
<h2>Installing</h2>
<p>
NPM is recommended for development, although for production you might want to find/build a package for your operating system:
</p>
<pre><code>npm install micro</code></pre>
<h2>A Basic Web App</h2>
<p>
The following web app returns the text "hello, world!":
</p>
<pre><code class="prettyprint">var WebApp = exports.WebApp = micro.webapp(),
get = WebApp.get;
get('/', function (request, response) {
response.ok('text/html');
return 'hello, world!';
});</code></pre>
<p>
To run the web app, create a directory and save the code above into a file called <code>lib/webapp.js</code> under your new directory. From within the directory run:
</p>
<pre><code>proton</code></pre>
<p>
Your new web app should be available at <a href="http://localhost:8000/">http://localhost:8000/</a>.
</p>
<h2>Documentation</h2>
<ul>
<li>
<a href="/micro/getting-started.html">Getting Started with Micro and Spectrum</a>
</li>
<li>
<a href="/micro/routes.html">Routing guide</a>
</li>
</ul>
<div class="ribbon">
<a href="http://github.com/usenode/micro.js" rel="me">Fork me on GitHub</a>
</div>
</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 class="selected">
<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>