김다솜

make node project

1 +var createError = require('http-errors');
2 +var express = require('express');
3 +var path = require('path');
4 +var cookieParser = require('cookie-parser');
5 +var logger = require('morgan');
6 +
7 +var indexRouter = require('./routes/index');
8 +var usersRouter = require('./routes/users');
9 +
10 +var app = express();
11 +
12 +// view engine setup
13 +app.set('views', path.join(__dirname, 'views'));
14 +app.set('view engine', 'jade');
15 +
16 +app.use(logger('dev'));
17 +app.use(express.json());
18 +app.use(express.urlencoded({ extended: false }));
19 +app.use(cookieParser());
20 +app.use(express.static(path.join(__dirname, 'public')));
21 +
22 +app.use('/', indexRouter);
23 +app.use('/users', usersRouter);
24 +
25 +// catch 404 and forward to error handler
26 +app.use(function(req, res, next) {
27 + next(createError(404));
28 +});
29 +
30 +// error handler
31 +app.use(function(err, req, res, next) {
32 + // set locals, only providing error in development
33 + res.locals.message = err.message;
34 + res.locals.error = req.app.get('env') === 'development' ? err : {};
35 +
36 + // render the error page
37 + res.status(err.status || 500);
38 + res.render('error');
39 +});
40 +
41 +module.exports = app;
1 +#!/usr/bin/env node
2 +
3 +/**
4 + * Module dependencies.
5 + */
6 +
7 +var app = require('../app');
8 +var debug = require('debug')('khuloud:server');
9 +var http = require('http');
10 +
11 +/**
12 + * Get port from environment and store in Express.
13 + */
14 +
15 +var port = normalizePort(process.env.PORT || '3000');
16 +app.set('port', port);
17 +
18 +/**
19 + * Create HTTP server.
20 + */
21 +
22 +var server = http.createServer(app);
23 +
24 +/**
25 + * Listen on provided port, on all network interfaces.
26 + */
27 +
28 +server.listen(port);
29 +server.on('error', onError);
30 +server.on('listening', onListening);
31 +
32 +/**
33 + * Normalize a port into a number, string, or false.
34 + */
35 +
36 +function normalizePort(val) {
37 + var port = parseInt(val, 10);
38 +
39 + if (isNaN(port)) {
40 + // named pipe
41 + return val;
42 + }
43 +
44 + if (port >= 0) {
45 + // port number
46 + return port;
47 + }
48 +
49 + return false;
50 +}
51 +
52 +/**
53 + * Event listener for HTTP server "error" event.
54 + */
55 +
56 +function onError(error) {
57 + if (error.syscall !== 'listen') {
58 + throw error;
59 + }
60 +
61 + var bind = typeof port === 'string'
62 + ? 'Pipe ' + port
63 + : 'Port ' + port;
64 +
65 + // handle specific listen errors with friendly messages
66 + switch (error.code) {
67 + case 'EACCES':
68 + console.error(bind + ' requires elevated privileges');
69 + process.exit(1);
70 + break;
71 + case 'EADDRINUSE':
72 + console.error(bind + ' is already in use');
73 + process.exit(1);
74 + break;
75 + default:
76 + throw error;
77 + }
78 +}
79 +
80 +/**
81 + * Event listener for HTTP server "listening" event.
82 + */
83 +
84 +function onListening() {
85 + var addr = server.address();
86 + var bind = typeof addr === 'string'
87 + ? 'pipe ' + addr
88 + : 'port ' + addr.port;
89 + debug('Listening on ' + bind);
90 +}
1 +{
2 + "name": "khuloud",
3 + "version": "0.0.0",
4 + "lockfileVersion": 1,
5 + "requires": true,
6 + "dependencies": {
7 + "accepts": {
8 + "version": "1.3.7",
9 + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.7.tgz",
10 + "integrity": "sha512-Il80Qs2WjYlJIBNzNkK6KYqlVMTbZLXgHx2oT0pU/fjRHyEp+PEfEPY0R3WCwAGVOtauxh1hOxNgIf5bv7dQpA==",
11 + "requires": {
12 + "mime-types": "~2.1.24",
13 + "negotiator": "0.6.2"
14 + }
15 + },
16 + "acorn": {
17 + "version": "2.7.0",
18 + "resolved": "https://registry.npmjs.org/acorn/-/acorn-2.7.0.tgz",
19 + "integrity": "sha1-q259nYhqrKiwhbwzEreaGYQz8Oc="
20 + },
21 + "acorn-globals": {
22 + "version": "1.0.9",
23 + "resolved": "https://registry.npmjs.org/acorn-globals/-/acorn-globals-1.0.9.tgz",
24 + "integrity": "sha1-VbtemGkVB7dFedBRNBMhfDgMVM8=",
25 + "requires": {
26 + "acorn": "^2.1.0"
27 + }
28 + },
29 + "align-text": {
30 + "version": "0.1.4",
31 + "resolved": "https://registry.npmjs.org/align-text/-/align-text-0.1.4.tgz",
32 + "integrity": "sha1-DNkKVhCT810KmSVsIrcGlDP60Rc=",
33 + "requires": {
34 + "kind-of": "^3.0.2",
35 + "longest": "^1.0.1",
36 + "repeat-string": "^1.5.2"
37 + }
38 + },
39 + "amdefine": {
40 + "version": "1.0.1",
41 + "resolved": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.1.tgz",
42 + "integrity": "sha1-SlKCrBZHKek2Gbz9OtFR+BfOkfU="
43 + },
44 + "array-flatten": {
45 + "version": "1.1.1",
46 + "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz",
47 + "integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI="
48 + },
49 + "asap": {
50 + "version": "1.0.0",
51 + "resolved": "https://registry.npmjs.org/asap/-/asap-1.0.0.tgz",
52 + "integrity": "sha1-sqRdpf36ILBJb8N2jMJ8EvqRan0="
53 + },
54 + "basic-auth": {
55 + "version": "2.0.1",
56 + "resolved": "https://registry.npmjs.org/basic-auth/-/basic-auth-2.0.1.tgz",
57 + "integrity": "sha512-NF+epuEdnUYVlGuhaxbbq+dvJttwLnGY+YixlXlME5KpQ5W3CnXA5cVTneY3SPbPDRkcjMbifrwmFYcClgOZeg==",
58 + "requires": {
59 + "safe-buffer": "5.1.2"
60 + }
61 + },
62 + "body-parser": {
63 + "version": "1.18.3",
64 + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.18.3.tgz",
65 + "integrity": "sha1-WykhmP/dVTs6DyDe0FkrlWlVyLQ=",
66 + "requires": {
67 + "bytes": "3.0.0",
68 + "content-type": "~1.0.4",
69 + "debug": "2.6.9",
70 + "depd": "~1.1.2",
71 + "http-errors": "~1.6.3",
72 + "iconv-lite": "0.4.23",
73 + "on-finished": "~2.3.0",
74 + "qs": "6.5.2",
75 + "raw-body": "2.3.3",
76 + "type-is": "~1.6.16"
77 + }
78 + },
79 + "bytes": {
80 + "version": "3.0.0",
81 + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.0.0.tgz",
82 + "integrity": "sha1-0ygVQE1olpn4Wk6k+odV3ROpYEg="
83 + },
84 + "camelcase": {
85 + "version": "1.2.1",
86 + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-1.2.1.tgz",
87 + "integrity": "sha1-m7UwTS4LVmmLLHWLCKPqqdqlijk="
88 + },
89 + "center-align": {
90 + "version": "0.1.3",
91 + "resolved": "https://registry.npmjs.org/center-align/-/center-align-0.1.3.tgz",
92 + "integrity": "sha1-qg0yYptu6XIgBBHL1EYckHvCt60=",
93 + "requires": {
94 + "align-text": "^0.1.3",
95 + "lazy-cache": "^1.0.3"
96 + }
97 + },
98 + "character-parser": {
99 + "version": "1.2.1",
100 + "resolved": "https://registry.npmjs.org/character-parser/-/character-parser-1.2.1.tgz",
101 + "integrity": "sha1-wN3kqxgnE7kZuXCVmhI+zBow/NY="
102 + },
103 + "clean-css": {
104 + "version": "3.4.28",
105 + "resolved": "https://registry.npmjs.org/clean-css/-/clean-css-3.4.28.tgz",
106 + "integrity": "sha1-vxlF6C/ICPVWlebd6uwBQA79A/8=",
107 + "requires": {
108 + "commander": "2.8.x",
109 + "source-map": "0.4.x"
110 + },
111 + "dependencies": {
112 + "commander": {
113 + "version": "2.8.1",
114 + "resolved": "https://registry.npmjs.org/commander/-/commander-2.8.1.tgz",
115 + "integrity": "sha1-Br42f+v9oMMwqh4qBy09yXYkJdQ=",
116 + "requires": {
117 + "graceful-readlink": ">= 1.0.0"
118 + }
119 + }
120 + }
121 + },
122 + "cliui": {
123 + "version": "2.1.0",
124 + "resolved": "https://registry.npmjs.org/cliui/-/cliui-2.1.0.tgz",
125 + "integrity": "sha1-S0dXYP+AJkx2LDoXGQMukcf+oNE=",
126 + "requires": {
127 + "center-align": "^0.1.1",
128 + "right-align": "^0.1.1",
129 + "wordwrap": "0.0.2"
130 + },
131 + "dependencies": {
132 + "wordwrap": {
133 + "version": "0.0.2",
134 + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.2.tgz",
135 + "integrity": "sha1-t5Zpu0LstAn4PVg8rVLKF+qhZD8="
136 + }
137 + }
138 + },
139 + "commander": {
140 + "version": "2.6.0",
141 + "resolved": "https://registry.npmjs.org/commander/-/commander-2.6.0.tgz",
142 + "integrity": "sha1-nfflL7Kgyw+4kFjugMMQQiXzfh0="
143 + },
144 + "constantinople": {
145 + "version": "3.0.2",
146 + "resolved": "https://registry.npmjs.org/constantinople/-/constantinople-3.0.2.tgz",
147 + "integrity": "sha1-S5RdmTeQe82Y7ldRIsOBdRZUQUE=",
148 + "requires": {
149 + "acorn": "^2.1.0"
150 + }
151 + },
152 + "content-disposition": {
153 + "version": "0.5.2",
154 + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.2.tgz",
155 + "integrity": "sha1-DPaLud318r55YcOoUXjLhdunjLQ="
156 + },
157 + "content-type": {
158 + "version": "1.0.4",
159 + "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz",
160 + "integrity": "sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA=="
161 + },
162 + "cookie": {
163 + "version": "0.4.0",
164 + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.0.tgz",
165 + "integrity": "sha512-+Hp8fLp57wnUSt0tY0tHEXh4voZRDnoIrZPqlo3DPiI4y9lwg/jqx+1Om94/W6ZaPDOUbnjOt/99w66zk+l1Xg=="
166 + },
167 + "cookie-parser": {
168 + "version": "1.4.5",
169 + "resolved": "https://registry.npmjs.org/cookie-parser/-/cookie-parser-1.4.5.tgz",
170 + "integrity": "sha512-f13bPUj/gG/5mDr+xLmSxxDsB9DQiTIfhJS/sqjrmfAWiAN+x2O4i/XguTL9yDZ+/IFDanJ+5x7hC4CXT9Tdzw==",
171 + "requires": {
172 + "cookie": "0.4.0",
173 + "cookie-signature": "1.0.6"
174 + }
175 + },
176 + "cookie-signature": {
177 + "version": "1.0.6",
178 + "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz",
179 + "integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw="
180 + },
181 + "css": {
182 + "version": "1.0.8",
183 + "resolved": "https://registry.npmjs.org/css/-/css-1.0.8.tgz",
184 + "integrity": "sha1-k4aBHKgrzMnuf7WnMrHioxfIo+c=",
185 + "requires": {
186 + "css-parse": "1.0.4",
187 + "css-stringify": "1.0.5"
188 + }
189 + },
190 + "css-parse": {
191 + "version": "1.0.4",
192 + "resolved": "https://registry.npmjs.org/css-parse/-/css-parse-1.0.4.tgz",
193 + "integrity": "sha1-OLBQP7+dqfVOnB29pg4UXHcRe90="
194 + },
195 + "css-stringify": {
196 + "version": "1.0.5",
197 + "resolved": "https://registry.npmjs.org/css-stringify/-/css-stringify-1.0.5.tgz",
198 + "integrity": "sha1-sNBClG2ylTu50pKQCmy19tASIDE="
199 + },
200 + "debug": {
201 + "version": "2.6.9",
202 + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz",
203 + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==",
204 + "requires": {
205 + "ms": "2.0.0"
206 + }
207 + },
208 + "decamelize": {
209 + "version": "1.2.0",
210 + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz",
211 + "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA="
212 + },
213 + "depd": {
214 + "version": "1.1.2",
215 + "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz",
216 + "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak="
217 + },
218 + "destroy": {
219 + "version": "1.0.4",
220 + "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz",
221 + "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA="
222 + },
223 + "ee-first": {
224 + "version": "1.1.1",
225 + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz",
226 + "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0="
227 + },
228 + "encodeurl": {
229 + "version": "1.0.2",
230 + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz",
231 + "integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k="
232 + },
233 + "escape-html": {
234 + "version": "1.0.3",
235 + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz",
236 + "integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg="
237 + },
238 + "etag": {
239 + "version": "1.8.1",
240 + "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz",
241 + "integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc="
242 + },
243 + "express": {
244 + "version": "4.16.4",
245 + "resolved": "https://registry.npmjs.org/express/-/express-4.16.4.tgz",
246 + "integrity": "sha512-j12Uuyb4FMrd/qQAm6uCHAkPtO8FDTRJZBDd5D2KOL2eLaz1yUNdUB/NOIyq0iU4q4cFarsUCrnFDPBcnksuOg==",
247 + "requires": {
248 + "accepts": "~1.3.5",
249 + "array-flatten": "1.1.1",
250 + "body-parser": "1.18.3",
251 + "content-disposition": "0.5.2",
252 + "content-type": "~1.0.4",
253 + "cookie": "0.3.1",
254 + "cookie-signature": "1.0.6",
255 + "debug": "2.6.9",
256 + "depd": "~1.1.2",
257 + "encodeurl": "~1.0.2",
258 + "escape-html": "~1.0.3",
259 + "etag": "~1.8.1",
260 + "finalhandler": "1.1.1",
261 + "fresh": "0.5.2",
262 + "merge-descriptors": "1.0.1",
263 + "methods": "~1.1.2",
264 + "on-finished": "~2.3.0",
265 + "parseurl": "~1.3.2",
266 + "path-to-regexp": "0.1.7",
267 + "proxy-addr": "~2.0.4",
268 + "qs": "6.5.2",
269 + "range-parser": "~1.2.0",
270 + "safe-buffer": "5.1.2",
271 + "send": "0.16.2",
272 + "serve-static": "1.13.2",
273 + "setprototypeof": "1.1.0",
274 + "statuses": "~1.4.0",
275 + "type-is": "~1.6.16",
276 + "utils-merge": "1.0.1",
277 + "vary": "~1.1.2"
278 + },
279 + "dependencies": {
280 + "cookie": {
281 + "version": "0.3.1",
282 + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.3.1.tgz",
283 + "integrity": "sha1-5+Ch+e9DtMi6klxcWpboBtFoc7s="
284 + }
285 + }
286 + },
287 + "finalhandler": {
288 + "version": "1.1.1",
289 + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.1.tgz",
290 + "integrity": "sha512-Y1GUDo39ez4aHAw7MysnUD5JzYX+WaIj8I57kO3aEPT1fFRL4sr7mjei97FgnwhAyyzRYmQZaTHb2+9uZ1dPtg==",
291 + "requires": {
292 + "debug": "2.6.9",
293 + "encodeurl": "~1.0.2",
294 + "escape-html": "~1.0.3",
295 + "on-finished": "~2.3.0",
296 + "parseurl": "~1.3.2",
297 + "statuses": "~1.4.0",
298 + "unpipe": "~1.0.0"
299 + }
300 + },
301 + "forwarded": {
302 + "version": "0.1.2",
303 + "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.1.2.tgz",
304 + "integrity": "sha1-mMI9qxF1ZXuMBXPozszZGw/xjIQ="
305 + },
306 + "fresh": {
307 + "version": "0.5.2",
308 + "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz",
309 + "integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac="
310 + },
311 + "graceful-readlink": {
312 + "version": "1.0.1",
313 + "resolved": "https://registry.npmjs.org/graceful-readlink/-/graceful-readlink-1.0.1.tgz",
314 + "integrity": "sha1-TK+tdrxi8C+gObL5Tpo906ORpyU="
315 + },
316 + "http-errors": {
317 + "version": "1.6.3",
318 + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.6.3.tgz",
319 + "integrity": "sha1-i1VoC7S+KDoLW/TqLjhYC+HZMg0=",
320 + "requires": {
321 + "depd": "~1.1.2",
322 + "inherits": "2.0.3",
323 + "setprototypeof": "1.1.0",
324 + "statuses": ">= 1.4.0 < 2"
325 + }
326 + },
327 + "iconv-lite": {
328 + "version": "0.4.23",
329 + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.23.tgz",
330 + "integrity": "sha512-neyTUVFtahjf0mB3dZT77u+8O0QB89jFdnBkd5P1JgYPbPaia3gXXOVL2fq8VyU2gMMD7SaN7QukTB/pmXYvDA==",
331 + "requires": {
332 + "safer-buffer": ">= 2.1.2 < 3"
333 + }
334 + },
335 + "inherits": {
336 + "version": "2.0.3",
337 + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz",
338 + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4="
339 + },
340 + "ipaddr.js": {
341 + "version": "1.9.1",
342 + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz",
343 + "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g=="
344 + },
345 + "is-buffer": {
346 + "version": "1.1.6",
347 + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz",
348 + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w=="
349 + },
350 + "is-promise": {
351 + "version": "2.2.2",
352 + "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.2.2.tgz",
353 + "integrity": "sha512-+lP4/6lKUBfQjZ2pdxThZvLUAafmZb8OAxFb8XXtiQmS35INgr85hdOGoEs124ez1FCnZJt6jau/T+alh58QFQ=="
354 + },
355 + "jade": {
356 + "version": "1.11.0",
357 + "resolved": "https://registry.npmjs.org/jade/-/jade-1.11.0.tgz",
358 + "integrity": "sha1-nIDlOMEtP7lcjZu5VZ+gzAQEBf0=",
359 + "requires": {
360 + "character-parser": "1.2.1",
361 + "clean-css": "^3.1.9",
362 + "commander": "~2.6.0",
363 + "constantinople": "~3.0.1",
364 + "jstransformer": "0.0.2",
365 + "mkdirp": "~0.5.0",
366 + "transformers": "2.1.0",
367 + "uglify-js": "^2.4.19",
368 + "void-elements": "~2.0.1",
369 + "with": "~4.0.0"
370 + }
371 + },
372 + "jstransformer": {
373 + "version": "0.0.2",
374 + "resolved": "https://registry.npmjs.org/jstransformer/-/jstransformer-0.0.2.tgz",
375 + "integrity": "sha1-eq4pqQPRls+glz2IXT5HlH7Ndqs=",
376 + "requires": {
377 + "is-promise": "^2.0.0",
378 + "promise": "^6.0.1"
379 + }
380 + },
381 + "kind-of": {
382 + "version": "3.2.2",
383 + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz",
384 + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=",
385 + "requires": {
386 + "is-buffer": "^1.1.5"
387 + }
388 + },
389 + "lazy-cache": {
390 + "version": "1.0.4",
391 + "resolved": "https://registry.npmjs.org/lazy-cache/-/lazy-cache-1.0.4.tgz",
392 + "integrity": "sha1-odePw6UEdMuAhF07O24dpJpEbo4="
393 + },
394 + "longest": {
395 + "version": "1.0.1",
396 + "resolved": "https://registry.npmjs.org/longest/-/longest-1.0.1.tgz",
397 + "integrity": "sha1-MKCy2jj3N3DoKUoNIuZiXtd9AJc="
398 + },
399 + "media-typer": {
400 + "version": "0.3.0",
401 + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz",
402 + "integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g="
403 + },
404 + "merge-descriptors": {
405 + "version": "1.0.1",
406 + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz",
407 + "integrity": "sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E="
408 + },
409 + "methods": {
410 + "version": "1.1.2",
411 + "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz",
412 + "integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4="
413 + },
414 + "mime": {
415 + "version": "1.4.1",
416 + "resolved": "https://registry.npmjs.org/mime/-/mime-1.4.1.tgz",
417 + "integrity": "sha512-KI1+qOZu5DcW6wayYHSzR/tXKCDC5Om4s1z2QJjDULzLcmf3DvzS7oluY4HCTrc+9FiKmWUgeNLg7W3uIQvxtQ=="
418 + },
419 + "mime-db": {
420 + "version": "1.44.0",
421 + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.44.0.tgz",
422 + "integrity": "sha512-/NOTfLrsPBVeH7YtFPgsVWveuL+4SjjYxaQ1xtM1KMFj7HdxlBlxeyNLzhyJVx7r4rZGJAZ/6lkKCitSc/Nmpg=="
423 + },
424 + "mime-types": {
425 + "version": "2.1.27",
426 + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.27.tgz",
427 + "integrity": "sha512-JIhqnCasI9yD+SsmkquHBxTSEuZdQX5BuQnS2Vc7puQQQ+8yiP5AY5uWhpdv4YL4VM5c6iliiYWPgJ/nJQLp7w==",
428 + "requires": {
429 + "mime-db": "1.44.0"
430 + }
431 + },
432 + "minimist": {
433 + "version": "1.2.5",
434 + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz",
435 + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw=="
436 + },
437 + "mkdirp": {
438 + "version": "0.5.5",
439 + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz",
440 + "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==",
441 + "requires": {
442 + "minimist": "^1.2.5"
443 + }
444 + },
445 + "morgan": {
446 + "version": "1.9.1",
447 + "resolved": "https://registry.npmjs.org/morgan/-/morgan-1.9.1.tgz",
448 + "integrity": "sha512-HQStPIV4y3afTiCYVxirakhlCfGkI161c76kKFca7Fk1JusM//Qeo1ej2XaMniiNeaZklMVrh3vTtIzpzwbpmA==",
449 + "requires": {
450 + "basic-auth": "~2.0.0",
451 + "debug": "2.6.9",
452 + "depd": "~1.1.2",
453 + "on-finished": "~2.3.0",
454 + "on-headers": "~1.0.1"
455 + }
456 + },
457 + "ms": {
458 + "version": "2.0.0",
459 + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz",
460 + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g="
461 + },
462 + "negotiator": {
463 + "version": "0.6.2",
464 + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.2.tgz",
465 + "integrity": "sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw=="
466 + },
467 + "on-finished": {
468 + "version": "2.3.0",
469 + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz",
470 + "integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=",
471 + "requires": {
472 + "ee-first": "1.1.1"
473 + }
474 + },
475 + "on-headers": {
476 + "version": "1.0.2",
477 + "resolved": "https://registry.npmjs.org/on-headers/-/on-headers-1.0.2.tgz",
478 + "integrity": "sha512-pZAE+FJLoyITytdqK0U5s+FIpjN0JP3OzFi/u8Rx+EV5/W+JTWGXG8xFzevE7AjBfDqHv/8vL8qQsIhHnqRkrA=="
479 + },
480 + "optimist": {
481 + "version": "0.3.7",
482 + "resolved": "https://registry.npmjs.org/optimist/-/optimist-0.3.7.tgz",
483 + "integrity": "sha1-yQlBrVnkJzMokjB00s8ufLxuwNk=",
484 + "requires": {
485 + "wordwrap": "~0.0.2"
486 + }
487 + },
488 + "parseurl": {
489 + "version": "1.3.3",
490 + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz",
491 + "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ=="
492 + },
493 + "path-to-regexp": {
494 + "version": "0.1.7",
495 + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz",
496 + "integrity": "sha1-32BBeABfUi8V60SQ5yR6G/qmf4w="
497 + },
498 + "promise": {
499 + "version": "6.1.0",
500 + "resolved": "https://registry.npmjs.org/promise/-/promise-6.1.0.tgz",
501 + "integrity": "sha1-LOcp9rlLRcJoka0GAsXJDgTG7vY=",
502 + "requires": {
503 + "asap": "~1.0.0"
504 + }
505 + },
506 + "proxy-addr": {
507 + "version": "2.0.6",
508 + "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.6.tgz",
509 + "integrity": "sha512-dh/frvCBVmSsDYzw6n926jv974gddhkFPfiN8hPOi30Wax25QZyZEGveluCgliBnqmuM+UJmBErbAUFIoDbjOw==",
510 + "requires": {
511 + "forwarded": "~0.1.2",
512 + "ipaddr.js": "1.9.1"
513 + }
514 + },
515 + "qs": {
516 + "version": "6.5.2",
517 + "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.2.tgz",
518 + "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA=="
519 + },
520 + "range-parser": {
521 + "version": "1.2.1",
522 + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz",
523 + "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg=="
524 + },
525 + "raw-body": {
526 + "version": "2.3.3",
527 + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.3.3.tgz",
528 + "integrity": "sha512-9esiElv1BrZoI3rCDuOuKCBRbuApGGaDPQfjSflGxdy4oyzqghxu6klEkkVIvBje+FF0BX9coEv8KqW6X/7njw==",
529 + "requires": {
530 + "bytes": "3.0.0",
531 + "http-errors": "1.6.3",
532 + "iconv-lite": "0.4.23",
533 + "unpipe": "1.0.0"
534 + }
535 + },
536 + "repeat-string": {
537 + "version": "1.6.1",
538 + "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz",
539 + "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc="
540 + },
541 + "right-align": {
542 + "version": "0.1.3",
543 + "resolved": "https://registry.npmjs.org/right-align/-/right-align-0.1.3.tgz",
544 + "integrity": "sha1-YTObci/mo1FWiSENJOFMlhSGE+8=",
545 + "requires": {
546 + "align-text": "^0.1.1"
547 + }
548 + },
549 + "safe-buffer": {
550 + "version": "5.1.2",
551 + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz",
552 + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g=="
553 + },
554 + "safer-buffer": {
555 + "version": "2.1.2",
556 + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz",
557 + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg=="
558 + },
559 + "send": {
560 + "version": "0.16.2",
561 + "resolved": "https://registry.npmjs.org/send/-/send-0.16.2.tgz",
562 + "integrity": "sha512-E64YFPUssFHEFBvpbbjr44NCLtI1AohxQ8ZSiJjQLskAdKuriYEP6VyGEsRDH8ScozGpkaX1BGvhanqCwkcEZw==",
563 + "requires": {
564 + "debug": "2.6.9",
565 + "depd": "~1.1.2",
566 + "destroy": "~1.0.4",
567 + "encodeurl": "~1.0.2",
568 + "escape-html": "~1.0.3",
569 + "etag": "~1.8.1",
570 + "fresh": "0.5.2",
571 + "http-errors": "~1.6.2",
572 + "mime": "1.4.1",
573 + "ms": "2.0.0",
574 + "on-finished": "~2.3.0",
575 + "range-parser": "~1.2.0",
576 + "statuses": "~1.4.0"
577 + }
578 + },
579 + "serve-static": {
580 + "version": "1.13.2",
581 + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.13.2.tgz",
582 + "integrity": "sha512-p/tdJrO4U387R9oMjb1oj7qSMaMfmOyd4j9hOFoxZe2baQszgHcSWjuya/CiT5kgZZKRudHNOA0pYXOl8rQ5nw==",
583 + "requires": {
584 + "encodeurl": "~1.0.2",
585 + "escape-html": "~1.0.3",
586 + "parseurl": "~1.3.2",
587 + "send": "0.16.2"
588 + }
589 + },
590 + "setprototypeof": {
591 + "version": "1.1.0",
592 + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.0.tgz",
593 + "integrity": "sha512-BvE/TwpZX4FXExxOxZyRGQQv651MSwmWKZGqvmPcRIjDqWub67kTKuIMx43cZZrS/cBBzwBcNDWoFxt2XEFIpQ=="
594 + },
595 + "source-map": {
596 + "version": "0.4.4",
597 + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.4.4.tgz",
598 + "integrity": "sha1-66T12pwNyZneaAMti092FzZSA2s=",
599 + "requires": {
600 + "amdefine": ">=0.0.4"
601 + }
602 + },
603 + "statuses": {
604 + "version": "1.4.0",
605 + "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.4.0.tgz",
606 + "integrity": "sha512-zhSCtt8v2NDrRlPQpCNtw/heZLtfUDqxBM1udqikb/Hbk52LK4nQSwr10u77iopCW5LsyHpuXS0GnEc48mLeew=="
607 + },
608 + "transformers": {
609 + "version": "2.1.0",
610 + "resolved": "https://registry.npmjs.org/transformers/-/transformers-2.1.0.tgz",
611 + "integrity": "sha1-XSPLNVYd2F3Gf7hIIwm0fVPM6ac=",
612 + "requires": {
613 + "css": "~1.0.8",
614 + "promise": "~2.0",
615 + "uglify-js": "~2.2.5"
616 + },
617 + "dependencies": {
618 + "is-promise": {
619 + "version": "1.0.1",
620 + "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-1.0.1.tgz",
621 + "integrity": "sha1-MVc3YcBX4zwukaq56W2gjO++duU="
622 + },
623 + "promise": {
624 + "version": "2.0.0",
625 + "resolved": "https://registry.npmjs.org/promise/-/promise-2.0.0.tgz",
626 + "integrity": "sha1-RmSKqdYFr10ucMMCS/WUNtoCuA4=",
627 + "requires": {
628 + "is-promise": "~1"
629 + }
630 + },
631 + "source-map": {
632 + "version": "0.1.43",
633 + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.1.43.tgz",
634 + "integrity": "sha1-wkvBRspRfBRx9drL4lcbK3+eM0Y=",
635 + "requires": {
636 + "amdefine": ">=0.0.4"
637 + }
638 + },
639 + "uglify-js": {
640 + "version": "2.2.5",
641 + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-2.2.5.tgz",
642 + "integrity": "sha1-puAqcNg5eSuXgEiLe4sYTAlcmcc=",
643 + "requires": {
644 + "optimist": "~0.3.5",
645 + "source-map": "~0.1.7"
646 + }
647 + }
648 + }
649 + },
650 + "type-is": {
651 + "version": "1.6.18",
652 + "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz",
653 + "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==",
654 + "requires": {
655 + "media-typer": "0.3.0",
656 + "mime-types": "~2.1.24"
657 + }
658 + },
659 + "uglify-js": {
660 + "version": "2.8.29",
661 + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-2.8.29.tgz",
662 + "integrity": "sha1-KcVzMUgFe7Th913zW3qcty5qWd0=",
663 + "requires": {
664 + "source-map": "~0.5.1",
665 + "uglify-to-browserify": "~1.0.0",
666 + "yargs": "~3.10.0"
667 + },
668 + "dependencies": {
669 + "source-map": {
670 + "version": "0.5.7",
671 + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz",
672 + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w="
673 + }
674 + }
675 + },
676 + "uglify-to-browserify": {
677 + "version": "1.0.2",
678 + "resolved": "https://registry.npmjs.org/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz",
679 + "integrity": "sha1-bgkk1r2mta/jSeOabWMoUKD4grc=",
680 + "optional": true
681 + },
682 + "unpipe": {
683 + "version": "1.0.0",
684 + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz",
685 + "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw="
686 + },
687 + "utils-merge": {
688 + "version": "1.0.1",
689 + "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz",
690 + "integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM="
691 + },
692 + "vary": {
693 + "version": "1.1.2",
694 + "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz",
695 + "integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw="
696 + },
697 + "void-elements": {
698 + "version": "2.0.1",
699 + "resolved": "https://registry.npmjs.org/void-elements/-/void-elements-2.0.1.tgz",
700 + "integrity": "sha1-wGavtYK7HLQSjWDqkjkulNXp2+w="
701 + },
702 + "window-size": {
703 + "version": "0.1.0",
704 + "resolved": "https://registry.npmjs.org/window-size/-/window-size-0.1.0.tgz",
705 + "integrity": "sha1-VDjNLqk7IC76Ohn+iIeu58lPnJ0="
706 + },
707 + "with": {
708 + "version": "4.0.3",
709 + "resolved": "https://registry.npmjs.org/with/-/with-4.0.3.tgz",
710 + "integrity": "sha1-7v0VTp550sjTQXtkeo8U2f7M4U4=",
711 + "requires": {
712 + "acorn": "^1.0.1",
713 + "acorn-globals": "^1.0.3"
714 + },
715 + "dependencies": {
716 + "acorn": {
717 + "version": "1.2.2",
718 + "resolved": "https://registry.npmjs.org/acorn/-/acorn-1.2.2.tgz",
719 + "integrity": "sha1-yM4n3grMdtiW0rH6099YjZ6C8BQ="
720 + }
721 + }
722 + },
723 + "wordwrap": {
724 + "version": "0.0.3",
725 + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz",
726 + "integrity": "sha1-o9XabNXAvAAI03I0u68b7WMFkQc="
727 + },
728 + "yargs": {
729 + "version": "3.10.0",
730 + "resolved": "https://registry.npmjs.org/yargs/-/yargs-3.10.0.tgz",
731 + "integrity": "sha1-9+572FfdfB0tOMDnTvvWgdFDH9E=",
732 + "requires": {
733 + "camelcase": "^1.0.2",
734 + "cliui": "^2.1.0",
735 + "decamelize": "^1.0.0",
736 + "window-size": "0.1.0"
737 + }
738 + }
739 + }
740 +}
1 +{
2 + "name": "khuloud",
3 + "version": "0.0.0",
4 + "private": true,
5 + "scripts": {
6 + "start": "node ./bin/www"
7 + },
8 + "dependencies": {
9 + "cookie-parser": "~1.4.4",
10 + "debug": "~2.6.9",
11 + "express": "~4.16.1",
12 + "http-errors": "~1.6.3",
13 + "jade": "~1.11.0",
14 + "morgan": "~1.9.1"
15 + }
16 +}
1 +body {
2 + padding: 50px;
3 + font: 14px "Lucida Grande", Helvetica, Arial, sans-serif;
4 +}
5 +
6 +a {
7 + color: #00B7FF;
8 +}
1 +var express = require('express');
2 +var router = express.Router();
3 +
4 +/* GET home page. */
5 +router.get('/', function(req, res, next) {
6 + res.render('index', { title: 'Express' });
7 +});
8 +
9 +module.exports = router;
1 +var express = require('express');
2 +var router = express.Router();
3 +
4 +/* GET users listing. */
5 +router.get('/', function(req, res, next) {
6 + res.send('respond with a resource');
7 +});
8 +
9 +module.exports = router;
1 +extends layout
2 +
3 +block content
4 + h1= message
5 + h2= error.status
6 + pre #{error.stack}
1 +extends layout
2 +
3 +block content
4 + h1= title
5 + p Welcome to #{title}
1 +doctype html
2 +html
3 + head
4 + title= title
5 + link(rel='stylesheet', href='/stylesheets/style.css')
6 + body
7 + block content