-
Notifications
You must be signed in to change notification settings - Fork 0
/
file.txt
422 lines (416 loc) · 72 KB
/
file.txt
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
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
diff --git a/AVS/app.js b/AVS/app.js
index eab696b..4c5cabd 100644
--- a/AVS/app.js
+++ b/AVS/app.js
@@ -1,51 +1,36 @@
var createError = require('http-errors');
var express = require('express');
+var expressLayouts = require('express-ejs-layouts');
var bodyParser = require('body-parser');
var multer = require('multer');
var upload = multer();
var path = require('path');
var cookieParser = require('cookie-parser');
var logger = require('morgan');
-//var mongoose = require('mongoose');
-
var indexRouter = require('./routes/index');
var searchRouter = require('./routes/search');
-
var app = express();
-//mongoose.connect('mongodb://localhost/Users');
-
-// view engine setup
app.set('views', path.join(__dirname, 'views'));
-app.set('view engine', 'hbs');
-//app.set('views', './views');
+app.set('view engine', 'ejs');
+app.use(expressLayouts);
+app.set('layout', 'layout');
app.use(logger('dev'));
app.use(express.json());
-//app.use(express.urlencoded({ extended: false }));
app.use(cookieParser());
app.use(express.static(path.join(__dirname, 'public')));
app.use(express.urlencoded())
-
app.use('/', indexRouter);
app.use('/search', searchRouter);
app.use(bodyParser.json());
-//app.use(bodyParser.urlencoded({ extended: true }));
app.use(upload.array());
app.use(express.static('public'));
-// catch 404 and forward to error handler
app.use(function(req, res, next) {
next(createError(404));
});
-
-
-// error handler
app.use(function(err, req, res, next) {
- // set locals, only providing error in development
res.locals.message = err.message;
res.locals.error = req.app.get('env') === 'development' ? err : {};
-
- // render the error page
res.status(err.status || 500);
res.render('error');
});
-
module.exports = app;
diff --git a/AVS/node_modules/body-parser/package.json b/AVS/node_modules/body-parser/package.json
index 65708cc..47dff3a 100644
--- a/AVS/node_modules/body-parser/package.json
+++ b/AVS/node_modules/body-parser/package.json
@@ -11,14 +11,14 @@
"toidentifier": "1.0.0"
},
"_requested": {
- "type": "tag",
- "registry": true,
- "raw": "body-parser",
- "name": "body-parser",
"escapedName": "body-parser",
+ "fetchSpec": "latest",
+ "name": "body-parser",
+ "raw": "body-parser",
"rawSpec": "",
+ "registry": true,
"saveSpec": null,
- "fetchSpec": "latest"
+ "type": "tag"
},
"_requiredBy": [
"#USER",
@@ -75,14 +75,17 @@
"node": ">= 0.8"
},
"files": [
- "lib/",
- "LICENSE",
"HISTORY.md",
- "index.js"
+ "LICENSE",
+ "index.js",
+ "lib/"
],
"homepage": "https://github.com/expressjs/body-parser#readme",
"license": "MIT",
"name": "body-parser",
+ "optionalDependencies": {},
+ "readme": "# body-parser\n\n[![NPM Version][npm-image]][npm-url]\n[![NPM Downloads][downloads-image]][downloads-url]\n[![Build Status][travis-image]][travis-url]\n[![Test Coverage][coveralls-image]][coveralls-url]\n\nNode.js body parsing middleware.\n\nParse incoming request bodies in a middleware before your handlers, available\nunder the `req.body` property.\n\n**Note** As `req.body`'s shape is based on user-controlled input, all\nproperties and values in this object are untrusted and should be validated\nbefore trusting. For example, `req.body.foo.toString()` may fail in multiple\nways, for example the `foo` property may not be there or may not be a string,\nand `toString` may not be a function and instead a string or other user input.\n\n[Learn about the anatomy of an HTTP transaction in Node.js](https://nodejs.org/en/docs/guides/anatomy-of-an-http-transaction/).\n\n_This does not handle multipart bodies_, due to their complex and typically\nlarge nature. For multipart bodies, you may be interested in the following\nmodules:\n\n * [busboy](https://www.npmjs.org/package/busboy#readme) and\n [connect-busboy](https://www.npmjs.org/package/connect-busboy#readme)\n * [multiparty](https://www.npmjs.org/package/multiparty#readme) and\n [connect-multiparty](https://www.npmjs.org/package/connect-multiparty#readme)\n * [formidable](https://www.npmjs.org/package/formidable#readme)\n * [multer](https://www.npmjs.org/package/multer#readme)\n\nThis module provides the following parsers:\n\n * [JSON body parser](#bodyparserjsonoptions)\n * [Raw body parser](#bodyparserrawoptions)\n * [Text body parser](#bodyparsertextoptions)\n * [URL-encoded form body parser](#bodyparserurlencodedoptions)\n\nOther body parsers you might be interested in:\n\n- [body](https://www.npmjs.org/package/body#readme)\n- [co-body](https://www.npmjs.org/package/co-body#readme)\n\n## Installation\n\n```sh\n$ npm install body-parser\n```\n\n## API\n\n<!-- eslint-disable no-unused-vars -->\n\n```js\nvar bodyParser = require('body-parser')\n```\n\nThe `bodyParser` object exposes various factories to create middlewares. All\nmiddlewares will populate the `req.body` property with the parsed body when\nthe `Content-Type` request header matches the `type` option, or an empty\nobject (`{}`) if there was no body to parse, the `Content-Type` was not matched,\nor an error occurred.\n\nThe various errors returned by this module are described in the\n[errors section](#errors).\n\n### bodyParser.json([options])\n\nReturns middleware that only parses `json` and only looks at requests where\nthe `Content-Type` header matches the `type` option. This parser accepts any\nUnicode encoding of the body and supports automatic inflation of `gzip` and\n`deflate` encodings.\n\nA new `body` object containing the parsed data is populated on the `request`\nobject after the middleware (i.e. `req.body`).\n\n#### Options\n\nThe `json` function takes an optional `options` object that may contain any of\nthe following keys:\n\n##### inflate\n\nWhen set to `true`, then deflated (compressed) bodies will be inflated; when\n`false`, deflated bodies are rejected. Defaults to `true`.\n\n##### limit\n\nControls the maximum request body size. If this is a number, then the value\nspecifies the number of bytes; if it is a string, the value is passed to the\n[bytes](https://www.npmjs.com/package/bytes) library for parsing. Defaults\nto `'100kb'`.\n\n##### reviver\n\nThe `reviver` option is passed directly to `JSON.parse` as the second\nargument. You can find more information on this argument\n[in the MDN documentation about JSON.parse](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse#Example.3A_Using_the_reviver_parameter).\n\n##### strict\n\nWhen set to `true`, will only accept arrays and objects; when `false` will\naccept anything `JSON.parse` accepts. Defaults to `true`.\n\n##### type\n\nThe `type` option is used to determine what media type the middleware will\nparse. This option can be a string, array of strings, or a function. If not a\nfunction, `type` option is passed directly to the\n[type-is](https://www.npmjs.org/package/type-is#readme) library and this can\nbe an extension name (like `json`), a mime type (like `application/json`), or\na mime type with a wildcard (like `*/*` or `*/json`). If a function, the `type`\noption is called as `fn(req)` and the request is parsed if it returns a truthy\nvalue. Defaults to `application/json`.\n\n##### verify\n\nThe `verify` option, if supplied, is called as `verify(req, res, buf, encoding)`,\nwhere `buf` is a `Buffer` of the raw request body and `encoding` is the\nencoding of the request. The parsing can be aborted by throwing an error.\n\n### bodyParser.raw([options])\n\nReturns middleware that parses all bodies as a `Buffer` and only looks at\nrequests where the `Content-Type` header matches the `type` option. This\nparser supports automatic inflation of `gzip` and `deflate` encodings.\n\nA new `body` object containing the parsed data is populated on the `request`\nobject after the middleware (i.e. `req.body`). This will be a `Buffer` object\nof the body.\n\n#### Options\n\nThe `raw` function takes an optional `options` object that may contain any of\nthe following keys:\n\n##### inflate\n\nWhen set to `true`, then deflated (compressed) bodies will be inflated; when\n`false`, deflated bodies are rejected. Defaults to `true`.\n\n##### limit\n\nControls the maximum request body size. If this is a number, then the value\nspecifies the number of bytes; if it is a string, the value is passed to the\n[bytes](https://www.npmjs.com/package/bytes) library for parsing. Defaults\nto `'100kb'`.\n\n##### type\n\nThe `type` option is used to determine what media type the middleware will\nparse. This option can be a string, array of strings, or a function.\nIf not a function, `type` option is passed directly to the\n[type-is](https://www.npmjs.org/package/type-is#readme) library and this\ncan be an extension name (like `bin`), a mime type (like\n`application/octet-stream`), or a mime type with a wildcard (like `*/*` or\n`application/*`). If a function, the `type` option is called as `fn(req)`\nand the request is parsed if it returns a truthy value. Defaults to\n`application/octet-stream`.\n\n##### verify\n\nThe `verify` option, if supplied, is called as `verify(req, res, buf, encoding)`,\nwhere `buf` is a `Buffer` of the raw request body and `encoding` is the\nencoding of the request. The parsing can be aborted by throwing an error.\n\n### bodyParser.text([options])\n\nReturns middleware that parses all bodies as a string and only looks at\nrequests where the `Content-Type` header matches the `type` option. This\nparser supports automatic inflation of `gzip` and `deflate` encodings.\n\nA new `body` string containing the parsed data is populated on the `request`\nobject after the middleware (i.e. `req.body`). This will be a string of the\nbody.\n\n#### Options\n\nThe `text` function takes an optional `options` object that may contain any of\nthe following keys:\n\n##### defaultCharset\n\nSpecify the default character set for the text content if the charset is not\nspecified in the `Content-Type` header of the request. Defaults to `utf-8`.\n\n##### inflate\n\nWhen set to `true`, then deflated (compressed) bodies will be inflated; when\n`false`, deflated bodies are rejected. Defaults to `true`.\n\n##### limit\n\nControls the maximum request body size. If this is a number, then the value\nspecifies the number of bytes; if it is a string, the value is passed to the\n[bytes](https://www.npmjs.com/package/bytes) library for parsing. Defaults\nto `'100kb'`.\n\n##### type\n\nThe `type` option is used to determine what media type the middleware will\nparse. This option can be a string, array of strings, or a function. If not\na function, `type` option is passed directly to the\n[type-is](https://www.npmjs.org/package/type-is#readme) library and this can\nbe an extension name (like `txt`), a mime type (like `text/plain`), or a mime\ntype with a wildcard (like `*/*` or `text/*`). If a function, the `type`\noption is called as `fn(req)` and the request is parsed if it returns a\ntruthy value. Defaults to `text/plain`.\n\n##### verify\n\nThe `verify` option, if supplied, is called as `verify(req, res, buf, encoding)`,\nwhere `buf` is a `Buffer` of the raw request body and `encoding` is the\nencoding of the request. The parsing can be aborted by throwing an error.\n\n### bodyParser.urlencoded([options])\n\nReturns middleware that only parses `urlencoded` bodies and only looks at\nrequests where the `Content-Type` header matches the `type` option. This\nparser accepts only UTF-8 encoding of the body and supports automatic\ninflation of `gzip` and `deflate` encodings.\n\nA new `body` object containing the parsed data is populated on the `request`\nobject after the middleware (i.e. `req.body`). This object will contain\nkey-value pairs, where the value can be a string or array (when `extended` is\n`false`), or any type (when `extended` is `true`).\n\n#### Options\n\nThe `urlencoded` function takes an optional `options` object that may contain\nany of the following keys:\n\n##### extended\n\nThe `extended` option allows to choose between parsing the URL-encoded data\nwith the `querystring` library (when `false`) or the `qs` library (when\n`true`). The \"extended\" syntax allows for rich objects and arrays to be\nencoded into the URL-encoded format, allowing for a JSON-like experience\nwith URL-encoded. For more information, please\n[see the qs library](https://www.npmjs.org/package/qs#readme).\n\nDefaults to `true`, but using the default has been deprecated. Please\nresearch into the difference between `qs` and `querystring` and choose the\nappropriate setting.\n\n##### inflate\n\nWhen set to `true`, then deflated (compressed) bodies will be inflated; when\n`false`, deflated bodies are rejected. Defaults to `true`.\n\n##### limit\n\nControls the maximum request body size. If this is a number, then the value\nspecifies the number of bytes; if it is a string, the value is passed to the\n[bytes](https://www.npmjs.com/package/bytes) library for parsing. Defaults\nto `'100kb'`.\n\n##### parameterLimit\n\nThe `parameterLimit` option controls the maximum number of parameters that\nare allowed in the URL-encoded data. If a request contains more parameters\nthan this value, a 413 will be returned to the client. Defaults to `1000`.\n\n##### type\n\nThe `type` option is used to determine what media type the middleware will\nparse. This option can be a string, array of strings, or a function. If not\na function, `type` option is passed directly to the\n[type-is](https://www.npmjs.org/package/type-is#readme) library and this can\nbe an extension name (like `urlencoded`), a mime type (like\n`application/x-www-form-urlencoded`), or a mime type with a wildcard (like\n`*/x-www-form-urlencoded`). If a function, the `type` option is called as\n`fn(req)` and the request is parsed if it returns a truthy value. Defaults\nto `application/x-www-form-urlencoded`.\n\n##### verify\n\nThe `verify` option, if supplied, is called as `verify(req, res, buf, encoding)`,\nwhere `buf` is a `Buffer` of the raw request body and `encoding` is the\nencoding of the request. The parsing can be aborted by throwing an error.\n\n## Errors\n\nThe middlewares provided by this module create errors depending on the error\ncondition during parsing. The errors will typically have a `status`/`statusCode`\nproperty that contains the suggested HTTP response code, an `expose` property\nto determine if the `message` property should be displayed to the client, a\n`type` property to determine the type of error without matching against the\n`message`, and a `body` property containing the read body, if available.\n\nThe following are the common errors emitted, though any error can come through\nfor various reasons.\n\n### content encoding unsupported\n\nThis error will occur when the request had a `Content-Encoding` header that\ncontained an encoding but the \"inflation\" option was set to `false`. The\n`status` property is set to `415`, the `type` property is set to\n`'encoding.unsupported'`, and the `charset` property will be set to the\nencoding that is unsupported.\n\n### request aborted\n\nThis error will occur when the request is aborted by the client before reading\nthe body has finished. The `received` property will be set to the number of\nbytes received before the request was aborted and the `expected` property is\nset to the number of expected bytes. The `status` property is set to `400`\nand `type` property is set to `'request.aborted'`.\n\n### request entity too large\n\nThis error will occur when the request body's size is larger than the \"limit\"\noption. The `limit` property will be set to the byte limit and the `length`\nproperty will be set to the request body's length. The `status` property is\nset to `413` and the `type` property is set to `'entity.too.large'`.\n\n### request size did not match content length\n\nThis error will occur when the request's length did not match the length from\nthe `Content-Length` header. This typically occurs when the request is malformed,\ntypically when the `Content-Length` header was calculated based on characters\ninstead of bytes. The `status` property is set to `400` and the `type` property\nis set to `'request.size.invalid'`.\n\n### stream encoding should not be set\n\nThis error will occur when something called the `req.setEncoding` method prior\nto this middleware. This module operates directly on bytes only and you cannot\ncall `req.setEncoding` when using this module. The `status` property is set to\n`500` and the `type` property is set to `'stream.encoding.set'`.\n\n### too many parameters\n\nThis error will occur when the content of the request exceeds the configured\n`parameterLimit` for the `urlencoded` parser. The `status` property is set to\n`413` and the `type` property is set to `'parameters.too.many'`.\n\n### unsupported charset \"BOGUS\"\n\nThis error will occur when the request had a charset parameter in the\n`Content-Type` header, but the `iconv-lite` module does not support it OR the\nparser does not support it. The charset is contained in the message as well\nas in the `charset` property. The `status` property is set to `415`, the\n`type` property is set to `'charset.unsupported'`, and the `charset` property\nis set to the charset that is unsupported.\n\n### unsupported content encoding \"bogus\"\n\nThis error will occur when the request had a `Content-Encoding` header that\ncontained an unsupported encoding. The encoding is contained in the message\nas well as in the `encoding` property. The `status` property is set to `415`,\nthe `type` property is set to `'encoding.unsupported'`, and the `encoding`\nproperty is set to the encoding that is unsupported.\n\n## Examples\n\n### Express/Connect top-level generic\n\nThis example demonstrates adding a generic JSON and URL-encoded parser as a\ntop-level middleware, which will parse the bodies of all incoming requests.\nThis is the simplest setup.\n\n```js\nvar express = require('express')\nvar bodyParser = require('body-parser')\n\nvar app = express()\n\n// parse application/x-www-form-urlencoded\napp.use(bodyParser.urlencoded({ extended: false }))\n\n// parse application/json\napp.use(bodyParser.json())\n\napp.use(function (req, res) {\n res.setHeader('Content-Type', 'text/plain')\n res.write('you posted:\\n')\n res.end(JSON.stringify(req.body, null, 2))\n})\n```\n\n### Express route-specific\n\nThis example demonstrates adding body parsers specifically to the routes that\nneed them. In general, this is the most recommended way to use body-parser with\nExpress.\n\n```js\nvar express = require('express')\nvar bodyParser = require('body-parser')\n\nvar app = express()\n\n// create application/json parser\nvar jsonParser = bodyParser.json()\n\n// create application/x-www-form-urlencoded parser\nvar urlencodedParser = bodyParser.urlencoded({ extended: false })\n\n// POST /login gets urlencoded bodies\napp.post('/login', urlencodedParser, function (req, res) {\n res.send('welcome, ' + req.body.username)\n})\n\n// POST /api/users gets JSON bodies\napp.post('/api/users', jsonParser, function (req, res) {\n // create user in req.body\n})\n```\n\n### Change accepted type for parsers\n\nAll the parsers accept a `type` option which allows you to change the\n`Content-Type` that the middleware will parse.\n\n```js\nvar express = require('express')\nvar bodyParser = require('body-parser')\n\nvar app = express()\n\n// parse various different custom JSON types as JSON\napp.use(bodyParser.json({ type: 'application/*+json' }))\n\n// parse some custom thing into a Buffer\napp.use(bodyParser.raw({ type: 'application/vnd.custom-type' }))\n\n// parse an HTML body into a string\napp.use(bodyParser.text({ type: 'text/html' }))\n```\n\n## License\n\n[MIT](LICENSE)\n\n[npm-image]: https://img.shields.io/npm/v/body-parser.svg\n[npm-url]: https://npmjs.org/package/body-parser\n[travis-image]: https://img.shields.io/travis/expressjs/body-parser/master.svg\n[travis-url]: https://travis-ci.org/expressjs/body-parser\n[coveralls-image]: https://img.shields.io/coveralls/expressjs/body-parser/master.svg\n[coveralls-url]: https://coveralls.io/r/expressjs/body-parser?branch=master\n[downloads-image]: https://img.shields.io/npm/dm/body-parser.svg\n[downloads-url]: https://npmjs.org/package/body-parser\n",
+ "readmeFilename": "README.md",
"repository": {
"type": "git",
"url": "git+https://github.com/expressjs/body-parser.git"
diff --git a/AVS/node_modules/express-handlebars/package.json b/AVS/node_modules/express-handlebars/package.json
index 4f7878c..2829975 100644
--- a/AVS/node_modules/express-handlebars/package.json
+++ b/AVS/node_modules/express-handlebars/package.json
@@ -6,14 +6,14 @@
"_location": "/express-handlebars",
"_phantomChildren": {},
"_requested": {
- "type": "tag",
- "registry": true,
- "raw": "express-handlebars",
- "name": "express-handlebars",
"escapedName": "express-handlebars",
+ "fetchSpec": "latest",
+ "name": "express-handlebars",
+ "raw": "express-handlebars",
"rawSpec": "",
+ "registry": true,
"saveSpec": null,
- "fetchSpec": "latest"
+ "type": "tag"
},
"_requiredBy": [
"#USER",
@@ -24,8 +24,8 @@
"_spec": "express-handlebars",
"_where": "/home/madhuparna/AVS",
"author": {
- "name": "Eric Ferraiuolo",
"email": "[email protected]",
+ "name": "Eric Ferraiuolo",
"url": "http://ericf.me/"
},
"bugs": {
@@ -53,14 +53,17 @@
"express",
"express3",
"handlebars",
- "view",
"layout",
"partials",
- "templates"
+ "templates",
+ "view"
],
"license": "BSD-3-Clause",
"main": "index.js",
"name": "express-handlebars",
+ "optionalDependencies": {},
+ "readme": "Express Handlebars\n==================\n\n[![Join the chat at https://gitter.im/ericf/express-handlebars](https://badges.gitter.im/ericf/express-handlebars.svg)](https://gitter.im/ericf/express-handlebars?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)\n\nA [Handlebars][] view engine for [Express][] which doesn't suck.\n\n[![npm version][npm-badge]][npm]\n[![dependency status][dep-badge]][dep-status]\n\n**This package used to be named `express3-handlebars`. The previous `express-handlebars` package by @jneen can be found [here][jneen-exphbs].**\n\n\n[Express]: https://github.com/visionmedia/express\n[Handlebars]: https://github.com/wycats/handlebars.js\n[npm]: https://www.npmjs.org/package/express-handlebars\n[npm-badge]: https://img.shields.io/npm/v/express-handlebars.svg?style=flat-square\n[dep-status]: https://david-dm.org/ericf/express-handlebars\n[dep-badge]: https://img.shields.io/david/ericf/express-handlebars.svg?style=flat-square\n[jneen-exphbs]: https://github.com/jneen/express-handlebars\n\n\n## Goals & Design\n\nI created this project out of frustration with the existing Handlebars view engines for Express. As of version 3.x, Express got out of the business of being a generic view engine — this was a great decision — leaving developers to implement the concepts of layouts, partials, and doing file I/O for their template engines of choice.\n\n### Goals and Features\n\nAfter building a half-dozen Express apps, I developed requirements and opinions about what a Handlebars view engine should provide and how it should be implemented. The following is that list:\n\n* Add back the concept of \"layout\", which was removed in Express 3.x.\n\n* Add back the concept of \"partials\" via Handlebars' partials mechanism.\n\n* Support a directory of partials; e.g., `{{> foo/bar}}` which exists on the file system at `views/partials/foo/bar.handlebars`, by default.\n\n* Smart file system I/O and template caching. When in development, templates are always loaded from disk. In production, raw files and compiled templates are cached, including partials.\n\n* All async and non-blocking. File system I/O is slow and servers should not be blocked from handling requests while reading from disk. I/O queuing is used to avoid doing unnecessary work.\n\n* Ability to easily precompile templates and partials for use on the client, enabling template sharing and reuse.\n\n* Ability to use a different Handlebars module/implementation other than the Handlebars npm package.\n\n### Package Design\n\nThis package was designed to work great for both the simple and complex use cases. I _intentionally_ made sure the full implementation is exposed and is easily overridable.\n\nThe package exports a function which can be invoked with no arguments or with a `config` object and it will return a function (closed over sensible defaults) which can be registered with an Express app. It's an engine factory function.\n\nThis exported engine factory has two properties which expose the underlying implementation:\n\n* `ExpressHandlebars()`: The constructor function which holds the internal implementation on its `prototype`. This produces instance objects which store their configuration, `compiled` and `precompiled` templates, and expose an `engine()` function which can be registered with an Express app.\n\n* `create()`: A convenience factory function for creating `ExpressHandlebars` instances.\n\nAn instance-based approach is used so that multiple `ExpressHandlebars` instances can be created with their own configuration, templates, partials, and helpers.\n\n\n## Installation\n\nInstall using npm:\n\n```shell\n$ npm install express-handlebars\n```\n\n\n## Usage\n\nThis view engine uses sensible defaults that leverage the \"Express-way\" of structuring an app's views. This makes it trivial to use in basic apps:\n\n### Basic Usage\n\n**Directory Structure:**\n\n```\n.\n├── app.js\n└── views\n ├── home.handlebars\n └── layouts\n └── main.handlebars\n\n2 directories, 3 files\n```\n\n**app.js:**\n\nCreates a super simple Express app which shows the basic way to register a Handlebars view engine using this package.\n\n```javascript\nvar express = require('express');\nvar exphbs = require('express-handlebars');\n\nvar app = express();\n\napp.engine('handlebars', exphbs());\napp.set('view engine', 'handlebars');\n\napp.get('/', function (req, res) {\n res.render('home');\n});\n\napp.listen(3000);\n```\n\n**views/layouts/main.handlebars:**\n\nThe main layout is the HTML page wrapper which can be reused for the different views of the app. `{{{body}}}` is used as a placeholder for where the main content should be rendered.\n\n```handlebars\n<!DOCTYPE html>\n<html>\n<head>\n <meta charset=\"utf-8\">\n <title>Example App</title>\n</head>\n<body>\n\n {{{body}}}\n\n</body>\n</html>\n```\n\n**views/home.handlebars:**\n\nThe content for the app's home view which will be rendered into the layout's `{{{body}}}`.\n\n```handlebars\n<h1>Example App: Home</h1>\n```\n\n#### Running the Example\n\nThe above example is bundled in this package's [examples directory][], where it can be run by:\n\n```shell\n$ cd examples/basic/\n$ npm install\n$ npm start\n```\n\n### Using Instances\n\nAnother way to use this view engine is to create an instance(s) of `ExpressHandlebars`, allowing access to the full API:\n\n```javascript\nvar express = require('express');\nvar exphbs = require('express-handlebars');\n\nvar app = express();\nvar hbs = exphbs.create({ /* config */ });\n\n// Register `hbs.engine` with the Express app.\napp.engine('handlebars', hbs.engine);\napp.set('view engine', 'handlebars');\n\n// ...still have a reference to `hbs`, on which methods like `loadPartials()`\n// can be called.\n```\n\n**Note:** The [Advanced Usage][] example demonstrates how `ExpressHandlebars` instances can be leveraged.\n\n### Template Caching\n\nThis view engine uses a smart template caching strategy. In development, templates will always be loaded from disk, i.e., no caching. In production, raw files and compiled Handlebars templates are aggressively cached.\n\nThe easiest way to control template/view caching is through Express' [view cache setting][]:\n\n```javascript\napp.enable('view cache');\n```\n\nExpress enables this setting by default when in production mode, i.e.:\n\n```\nprocess.env.NODE_ENV === \"production\"\n```\n\n**Note:** All of the public API methods accept `options.cache`, which gives control over caching when calling these methods directly.\n\n### Layouts\n\nA layout is simply a Handlebars template with a `{{{body}}}` placeholder. Usually it will be an HTML page wrapper into which views will be rendered.\n\nThis view engine adds back the concept of \"layout\", which was removed in Express 3.x. It can be configured with a path to the layouts directory, by default it's set to relative to `express settings.view` + `layouts/`\n\nThere are two ways to set a default layout: configuring the view engine's `defaultLayout` property, or setting [Express locals][] `app.locals.layout`.\n\nThe layout into which a view should be rendered can be overridden per-request by assigning a different value to the `layout` request local. The following will render the \"home\" view with no layout:\n\n```javascript\napp.get('/', function (req, res, next) {\n res.render('home', {layout: false});\n});\n```\n\n### Helpers\n\nHelper functions, or \"helpers\" are functions that can be [registered with Handlebars][] and can be called within a template. Helpers can be used for transforming output, iterating over data, etc. To keep with the spirit of *logic-less* templates, helpers are the place where logic should be defined.\n\nHandlebars ships with some [built-in helpers][], such as: `with`, `if`, `each`, etc. Most application will need to extend this set of helpers to include app-specific logic and transformations. Beyond defining global helpers on `Handlebars`, this view engine supports `ExpressHandlebars` instance-level helpers via the `helpers` configuration property, and render-level helpers via `options.helpers` when calling the `render()` and `renderView()` methods.\n\nThe following example shows helpers being specified at each level:\n\n**app.js:**\n\nCreates a super simple Express app which shows the basic way to register `ExpressHandlebars` instance-level helpers, and override one at the render-level.\n\n```javascript\nvar express = require('express');\nvar exphbs = require('express-handlebars');\n\nvar app = express();\n\nvar hbs = exphbs.create({\n // Specify helpers which are only registered on this instance.\n helpers: {\n foo: function () { return 'FOO!'; },\n bar: function () { return 'BAR!'; }\n }\n});\n\napp.engine('handlebars', hbs.engine);\napp.set('view engine', 'handlebars');\n\napp.get('/', function (req, res, next) {\n res.render('home', {\n showTitle: true,\n\n // Override `foo` helper only for this rendering.\n helpers: {\n foo: function () { return 'foo.'; }\n }\n });\n});\n\napp.listen(3000);\n```\n\n**views/home.handlebars:**\n\nThe app's home view which uses helper functions to help render the contents.\n\n```handlebars\n<!DOCTYPE html>\n<html>\n<head>\n <meta charset=\"utf-8\">\n <title>Example App - Home</title>\n</head>\n<body>\n\n <!-- Uses built-in `if` helper. -->\n {{#if showTitle}}\n <h1>Home</h1>\n {{/if}}\n\n <!-- Calls `foo` helper, overridden at render-level. -->\n <p>{{foo}}</p>\n\n <!-- Calls `bar` helper, defined at instance-level. -->\n <p>{{bar}}</p>\n\n</body>\n</html>\n```\n\n#### More on Helpers\n\nRefer to the [Handlebars website][] for more information on defining helpers:\n\n* [Expression Helpers][]\n* [Block Helpers][]\n\n### Metadata\n\nHandlebars has a data channel feature that propagates data through all scopes, including helpers and partials. Values in the data channel can be accessed via the `{{@variable}}` syntax. Express Handlebars provides metadata about a template it renders on a `{{@exphbs}}` object allowing access to things like the view name passed to `res.render()` via `{{@exphbs.view}}`.\n\nThe following is the list of metadata that's accessible on the `{{@exphbs}}` data object:\n\n* `cache`: Boolean whether or not the template is cached.\n* `view`: String name of the view passed to `res.render()`.\n* `layout`: String name of the layout view.\n* `data`: Original data object passed when rendering the template.\n* `helpers`: Collection of helpers used when rendering the template.\n* `partials`: Collection of partials used when rendering the template.\n\n\n[examples directory]: https://github.com/ericf/express-handlebars/tree/master/examples\n[view cache setting]: http://expressjs.com/api.html#app-settings\n[Express locals]: http://expressjs.com/api.html#app.locals\n[registered with Handlebars]: https://github.com/wycats/handlebars.js/#registering-helpers\n[built-in helpers]: http://handlebarsjs.com/#builtins\n[Handlebars website]: http://handlebarsjs.com/\n[Expression Helpers]: http://handlebarsjs.com/expressions.html#helpers\n[Block Helpers]: http://handlebarsjs.com/block_helpers.html\n\n\n## API\n\n### Configuration and Defaults\n\nThere are two main ways to use this package: via its engine factory function, or creating `ExpressHandlebars` instances; both use the same configuration properties and defaults.\n\n```javascript\nvar exphbs = require('express-handlebars');\n\n// Using the engine factory:\nexphbs({ /* config */ });\n\n// Create an instance:\nexphbs.create({ /* config */ });\n```\n\nThe following is the list of configuration properties and their default values (if any):\n\n#### `handlebars=require('handlebars')`\nThe Handlebars module/implementation. This allows for the `ExpressHandlebars` instance to use a different Handlebars module/implementation than that provided by the Handlebars npm package.\n\n#### `extname=\".handlebars\"`\nThe string name of the file extension used by the templates. This value should correspond with the `extname` under which this view engine is registered with Express when calling `app.engine()`.\n\nThe following example sets up an Express app to use `.hbs` as the file extension for views:\n\n```javascript\nvar express = require('express');\nvar exphbs = require('express-handlebars');\n\nvar app = express();\n\napp.engine('.hbs', exphbs({extname: '.hbs'}));\napp.set('view engine', '.hbs');\n```\n\n**Note:** Setting the app's `\"view engine\"` setting will make that value the default file extension used for looking up views.\n\n#### `layoutsDir`\nDefault layouts directory is relative to `express settings.view` + `layouts/`\nThe string path to the directory where the layout templates reside.\n\n**Note:** If you configure Express to look for views in a custom location (e.g., `app.set('views', 'some/path/')`), and if your `partialsDir` is not relative to `express settings.view` + `layouts/`, you will need to reflect that by passing an updated path as the `layoutsDir` property in your configuration.\n\n#### `partialsDir`\nDefault partials directory is relative to `express settings.view` + `partials/`\nThe string path to the directory where the partials templates reside or object with the following properties:\n\n* `dir`: The string path to the directory where the partials templates reside.\n* `namespace`: Optional string namespace to prefix the partial names.\n* `templates`: Optional collection (or promise of a collection) of templates in the form: `{filename: template}`.\n\n**Note:** If you configure Express to look for views in a custom location (e.g., `app.set('views', 'some/path/')`), and if your `partialsDir` is not relative to `express settings.view` + `partials/`, you will need to reflect that by passing an updated path as the `partialsDir` property in your configuration.\n\n**Note:** Multiple partials dirs can be used by making `partialsDir` an array of strings, and/or config objects as described above. The namespacing feature is useful if multiple partials dirs are used and their file paths might clash.\n\n#### `defaultLayout`\nThe string name or path of a template in the `layoutsDir` to use as the default layout. `main` is used as the default. This is overridden by a `layout` specified in the app or response `locals`. **Note:** A falsy value will render without a layout; e.g., `res.render('home', {layout: false});`.\n\n#### `helpers`\nAn object which holds the helper functions used when rendering templates with this `ExpressHandlebars` instance. When rendering a template, a collection of helpers will be generated by merging: `handlebars.helpers` (global), `helpers` (instance), and `options.helpers` (render-level). This allows Handlebars' `registerHelper()` function to operate as expected, will providing two extra levels over helper overrides.\n\n#### `compilerOptions`\nAn object which holds options that will be passed along to the Handlebars compiler functions: `Handlebars.compile()` and `Handlebars.precompile()`.\n\n### Properties\n\nThe public API properties are provided via `ExpressHandlebars` instances. In additional to the properties listed in the **Configuration and Defaults** section, the following are additional public properties:\n\n#### `engine`\nA function reference to the `renderView()` method which is bound to `this` `ExpressHandlebars` instance. This bound function should be used when registering this view engine with an Express app.\n\n#### `extname`\nThe normalized `extname` which will _always_ start with `.` and defaults to `.handlebars`.\n\n#### `compiled`\nAn object cache which holds compiled Handlebars template functions in the format: `{\"path/to/template\": [Function]}`.\n\n#### `precompiled`\nAn object cache which holds precompiled Handlebars template strings in the format: `{\"path/to/template\": [String]}`.\n\n### Methods\n\nThe following is the list of public API methods provided via `ExpressHandlebars` instances:\n\n**Note:** All of the public methods return a [`Promise`][promise] (with the exception of `renderView()` which is the interface with Express.)\n\n#### `getPartials([options])`\nRetrieves the partials in the `partialsDir` and returns a Promise for an object mapping the partials in the form `{name: partial}`.\n\nBy default each partial will be a compiled Handlebars template function. Use `options.precompiled` to receive the partials as precompiled templates — this is useful for sharing templates with client code.\n\n**Parameters:**\n\n* `[options]`: Optional object containing any of the following properties:\n\n * `[cache]`: Whether cached templates can be used if they have already been requested. This is recommended for production to avoid unnecessary file I/O.\n\n * `[precompiled=false]`: Whether precompiled templates should be provided, instead of compiled Handlebars template functions.\n\nThe name of each partial corresponds to its location in `partialsDir`. For example, consider the following directory structure:\n\n```\nviews\n└── partials\n ├── foo\n │ └── bar.handlebars\n └── title.handlebars\n\n2 directories, 2 files\n```\n\n`getPartials()` would produce the following result:\n\n```javascript\nvar hbs = require('express-handlebars').create();\n\nhbs.getPartials().then(function (partials) {\n console.log(partials);\n // => { 'foo/bar': [Function],\n // => title: [Function] }\n});\n```\n\n#### `getTemplate(filePath, [options])`\nRetrieves the template at the specified `filePath` and returns a Promise for the compiled Handlebars template function.\n\nUse `options.precompiled` to receive a precompiled Handlebars template.\n\n**Parameters:**\n\n* `filePath`: String path to the Handlebars template file.\n\n* `[options]`: Optional object containing any of the following properties:\n\n * `[cache]`: Whether a cached template can be used if it have already been requested. This is recommended for production to avoid necessary file I/O.\n\n * `[precompiled=false]`: Whether a precompiled template should be provided, instead of a compiled Handlebars template function.\n\n#### `getTemplates(dirPath, [options])`\nRetrieves all the templates in the specified `dirPath` and returns a Promise for an object mapping the compiled templates in the form `{filename: template}`.\n\nUse `options.precompiled` to receive precompiled Handlebars templates — this is useful for sharing templates with client code.\n\n**Parameters:**\n\n* `dirPath`: String path to the directory containing Handlebars template files.\n\n* `[options]`: Optional object containing any of the following properties:\n\n * `[cache]`: Whether cached templates can be used if it have already been requested. This is recommended for production to avoid necessary file I/O.\n\n * `[precompiled=false]`: Whether precompiled templates should be provided, instead of a compiled Handlebars template function.\n\n#### `render(filePath, context, [options])`\nRenders the template at the specified `filePath` with the `context`, using this instance's `helpers` and partials by default, and returns a Promise for the resulting string.\n\n**Parameters:**\n\n* `filePath`: String path to the Handlebars template file.\n\n* `context`: Object in which the template will be executed. This contains all of the values to fill into the template.\n\n* `[options]`: Optional object which can contain any of the following properties which affect this view engine's behavior:\n\n * `[cache]`: Whether a cached template can be used if it have already been requested. This is recommended for production to avoid unnecessary file I/O.\n\n * `[data]`: Optional object which can contain any data that Handlebars will pipe through the template, all helpers, and all partials. This is a side data channel.\n\n * `[helpers]`: Render-level helpers that will be used instead of any instance-level helpers; these will be merged with (and will override) any global Handlebars helper functions.\n\n * `[partials]`: Render-level partials that will be used instead of any instance-level partials. This is used internally as an optimization to avoid re-loading all the partials.\n\n#### `renderView(viewPath, options|callback, [callback])`\nRenders the template at the specified `viewPath` as the `{{{body}}}` within the layout specified by the `defaultLayout` or `options.layout`. Rendering will use this instance's `helpers` and partials, and passes the resulting string to the `callback`.\n\nThis method is called by Express and is the main entry point into this Express view engine implementation. It adds the concept of a \"layout\" and delegates rendering to the `render()` method.\n\nThe `options` will be used both as the context in which the Handlebars templates are rendered, and to signal this view engine on how it should behave, e.g., `options.cache=false` will load _always_ load the templates from disk.\n\n**Parameters:**\n\n* `viewPath`: String path to the Handlebars template file which should serve as the `{{{body}}}` when using a layout.\n\n* `[options]`: Optional object which will serve as the context in which the Handlebars templates are rendered. It may also contain any of the following properties which affect this view engine's behavior:\n\n * `[cache]`: Whether cached templates can be used if they have already been requested. This is recommended for production to avoid unnecessary file I/O.\n\n * `[data]`: Optional object which can contain any data that Handlebars will pipe through the template, all helpers, and all partials. This is a side data channel.\n\n * `[helpers]`: Render-level helpers that will be merged with (and will override) instance and global helper functions.\n\n * `[partials]`: Render-level partials will be merged with (and will override) instance and global partials. This should be a `{partialName: fn}` hash or a Promise of an object with this shape.\n\n * `[layout]`: Optional string path to the Handlebars template file to be used as the \"layout\". This overrides any `defaultLayout` value. Passing a falsy value will render with no layout (even if a `defaultLayout` is defined).\n\n* `callback`: Function to call once the template is retrieved.\n\n### Hooks\n\nThe following is the list of protected methods that are called internally and serve as _hooks_ to override functionality of `ExpressHandlebars` instances. A value or a promise can be returned from these methods which allows them to perform async operations.\n\n#### `_compileTemplate(template, options)`\nThis hook will be called when a Handlebars template needs to be compiled. This function needs to return a compiled Handlebars template function, or a promise for one.\n\nBy default this hook calls `Handlebars.compile()`, but it can be overridden to preform operations before and/or after Handlebars compiles the template. This is useful if you wanted to first process Markdown within a Handlebars template.\n\n**Parameters:**\n\n* `template`: String Handlebars template that needs to be compiled.\n\n* `options`: Object `compilerOptions` that were specified when the `ExpressHandlebars` instance as created. This object should be passed along to the `Handlebars.compile()` function.\n\n#### `_precompileTemplate(template, options)`\nThis hook will be called when a Handlebars template needs to be precompiled. This function needs to return a serialized Handlebars template spec. string, or a promise for one.\n\nBy default this hook calls `Handlebars.precompile()`, but it can be overridden to preform operations before and/or after Handlebars precompiles the template. This is useful if you wanted to first process Markdown within a Handlebars template.\n\n**Parameters:**\n\n* `template`: String Handlebars template that needs to be precompiled.\n\n* `options`: Object `compilerOptions` that were specified when the `ExpressHandlebars` instance as created. This object should be passed along to the `Handlebars.compile()` function.\n\n#### `_renderTemplate(template, context, options)`\nThis hook will be called when a compiled Handlebars template needs to be rendered. This function needs to returned the rendered output string, or a promise for one.\n\nBy default this hook simply calls the passed-in `template` with the `context` and `options` arguments, but it can be overridden to perform operations before and/or after rendering the template.\n\n**Parameters:**\n\n* `template`: Compiled Handlebars template function to call.\n\n* `context`: The context object in which to render the `template`.\n\n* `options`: Object that contains options and metadata for rendering the template:\n\n * `data`: Object to define custom `@variable` private variables.\n\n * `helpers`: Object to provide custom helpers in addition to the globally defined helpers.\n\n * `partials`: Object to provide custom partials in addition to the globally defined partials.\n\n\n[promise]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise\n\n\n## Examples\n\n### [Basic Usage][]\n\nThis example shows the most basic way to use this view engine.\n\n### [Advanced Usage][]\n\nThis example is more comprehensive and shows how to use many of the features of this view engine, including helpers, partials, multiple layouts, etc.\n\nAs noted in the **Package Design** section, this view engine's implementation is instance-based, and more advanced usages can take advantage of this. The Advanced Usage example demonstrates how to use an `ExpressHandlebars` instance to share templates with the client, among other features.\n\n\n[Basic Usage]: https://github.com/ericf/express-handlebars/tree/master/examples/basic\n[Advanced Usage]: https://github.com/ericf/express-handlebars/tree/master/examples/advanced\n\n\nLicense\n-------\n\nThis software is free to use under the Yahoo! Inc. BSD license. See the [LICENSE file][] for license text and copyright information.\n\n\n[LICENSE file]: https://github.com/ericf/express-handlebars/blob/master/LICENSE\n",
+ "readmeFilename": "README.md",
"repository": {
"type": "git",
"url": "git://github.com/ericf/express-handlebars.git"
diff --git a/AVS/node_modules/firebase/package.json b/AVS/node_modules/firebase/package.json
index e15bd01..c0b42a0 100644
--- a/AVS/node_modules/firebase/package.json
+++ b/AVS/node_modules/firebase/package.json
@@ -6,14 +6,14 @@
"_location": "/firebase",
"_phantomChildren": {},
"_requested": {
- "type": "tag",
- "registry": true,
- "raw": "firebase",
- "name": "firebase",
"escapedName": "firebase",
+ "fetchSpec": "latest",
+ "name": "firebase",
+ "raw": "firebase",
"rawSpec": "",
+ "registry": true,
"saveSpec": null,
- "fetchSpec": "latest"
+ "type": "tag"
},
"_requiredBy": [
"#USER",
@@ -24,8 +24,8 @@
"_spec": "firebase",
"_where": "/home/madhuparna/AVS",
"author": {
- "name": "Firebase",
"email": "[email protected]",
+ "name": "Firebase",
"url": "https://firebase.google.com/"
},
"browser": "dist/index.cjs.js",
@@ -42,9 +42,9 @@
"functions",
"installations",
"messaging",
- "storage",
"performance",
- "remote-config"
+ "remote-config",
+ "storage"
],
"dependencies": {
"@firebase/analytics": "0.2.3",
@@ -79,28 +79,31 @@
"files": [
"**/dist/",
"**/package.json",
+ "/empty-import.d.ts",
+ "/externs",
"/firebase*.js",
"/firebase*.map",
- "/index.d.ts",
- "/empty-import.d.ts",
- "/externs"
+ "/index.d.ts"
],
"homepage": "https://firebase.google.com/",
"keywords": [
+ "Firebase",
"authentication",
"database",
- "Firebase",
"firebase",
- "realtime",
- "storage",
"performance",
- "remote-config"
+ "realtime",
+ "remote-config",
+ "storage"
],
"license": "Apache-2.0",
"main": "dist/index.node.cjs.js",
"module": "dist/index.esm.js",
"name": "firebase",
+ "optionalDependencies": {},
"react-native": "dist/index.rn.cjs.js",
+ "readme": "[![Build Status](https://travis-ci.org/firebase/firebase-js-sdk.svg?branch=master)](https://travis-ci.org/firebase/firebase-js-sdk)\n\n# Firebase - App success made simple\n\n## Overview\n\n[Firebase](https://firebase.google.com) provides the tools and infrastructure\nyou need to develop, grow, and earn money from your app. This package supports\nweb (browser), mobile-web, and server (Node.js) clients.\n\nFor more information, visit:\n\n- [Firebase Realtime Database](https://firebase.google.com/docs/database/web/start) -\n The Firebase Realtime Database lets you store and query user data, and makes\n it available between users in realtime.\n- [Cloud Firestore](https://firebase.google.com/docs/firestore/quickstart) -\n Cloud Firestore is a flexible, scalable database for mobile, web, and server \n development from Firebase and Google Cloud Platform.\n- [Firebase Storage](https://firebase.google.com/docs/storage/web/start) -\n Firebase Storage lets you upload and store user generated content, such as\n files, and images.\n- [Firebase Cloud Messaging](https://firebase.google.com/docs/cloud-messaging/js/client) -\n Firebase Cloud Messaging is a cross-platform messaging solution that lets you\n reliably deliver messages at no cost.\n- [Firebase Authentication](https://firebase.google.com/docs/auth/web/manage-users) -\n Firebase helps you authenticate and manage users who access your application.\n- [Create and setup your account](https://firebase.google.com/docs/web/setup) -\n Get started using Firebase for free.\n\nThis SDK is intended for end-user client access from environments such as the\nWeb, mobile Web (e.g. React Native, Ionic), Node.js desktop (e.g. Electron), or\nIoT devices running Node.js. If you are instead interested in using a Node.js\nSDK which grants you admin access from a privileged environment (like a server),\nyou should use the\n[Firebase Admin Node.js SDK](https://firebase.google.com/docs/admin/setup/).\n\n## Get the code (browser)\n\n### Script include\n\nInclude Firebase in your web application via a `<script>` tag:\n\n```html\n<script src=\"https://www.gstatic.com/firebasejs/${JSCORE_VERSION}/firebase.js\"></script>\n\n<script>\n var app = firebase.initializeApp({\n apiKey: '<your-api-key>',\n authDomain: '<your-auth-domain>',\n databaseURL: '<your-database-url>',\n projectId: '<your-cloud-firestore-project>',\n storageBucket: '<your-storage-bucket>',\n messagingSenderId: '<your-sender-id>'\n });\n // ...\n</script>\n```\n\n*Note: To get a filled in version of the above code snippet, go to the\n[Firebase console](https://console.firebase.google.com/) for your app and click on \"Add\nFirebase to your web app\".*\n\n### npm bundler (Browserify, Webpack, etc.)\n\nThe Firebase JavaScript npm package contains code that can be run in the browser\nafter combining the modules you use with a package bundler (e.g.,\n[Browserify](http://browserify.org/), [Webpack](https://webpack.github.io/)).\n\nInstall the Firebase npm module:\n\n```\n$ npm init\n$ npm install --save firebase\n```\n\nIn your code, you can access Firebase using:\n\n```js\nvar firebase = require('firebase');\nvar app = firebase.initializeApp({ ... });\n```\n\nIf you are using ES6 imports or TypeScript:\n\n```js\nimport * as firebase from 'firebase';\nvar app = firebase.initializeApp({ ... });\n```\n\n### Include only the features you need\n\nThe full Firebase JavaScript client includes support for Firebase Authentication, the\nFirebase Realtime Database, Firebase Storage, and Firebase Cloud Messaging. Including\ncode via the above snippets will pull in all of these features.\n\nYou can reduce the amount of code your app uses by just including the features\nyou need. The individually installable services are:\n\n- `firebase-app` - The core `firebase` client (required).\n- `firebase-auth` - Firebase Authentication (optional).\n- `firebase-database` - The Firebase Realtime Database (optional).\n- `firebase-firestore` - Cloud Firestore (optional).\n- `firebase-storage` - Firebase Storage (optional).\n- `firebase-messaging` - Firebase Cloud Messaging (optional).\n- `firebase-functions` - Firebase Cloud Functions (optional).\n\nFrom the CDN, include the individual services you use (include `firebase-app`\nfirst):\n\n```html\n<script src=\"https://www.gstatic.com/firebasejs/${FIREBASE_VERSION}/firebase-app.js\"></script>\n<script src=\"https://www.gstatic.com/firebasejs/${FIREBASE_VERSION}/firebase-auth.js\"></script>\n<script src=\"https://www.gstatic.com/firebasejs/${FIREBASE_VERSION}/firebase-database.js\"></script>\n<script src=\"https://www.gstatic.com/firebasejs/${FIREBASE_VERSION}/firebase-firestore.js\"></script>\n<script src=\"https://www.gstatic.com/firebasejs/${FIREBASE_VERSION}/firebase-storage.js\"></script>\n<script src=\"https://www.gstatic.com/firebasejs/${FIREBASE_VERSION}/firebase-messaging.js\"></script>\n<script src=\"https://www.gstatic.com/firebasejs/${FIREBASE_VERSION}/firebase-functions.js\"></script>\n\n<script>\n var app = firebase.initializeApp({ ... });\n // ...\n</script>\n```\n\nWhen using the firebase npm package, you can `require()` just the services that\nyou use:\n\n```js\nvar firebase = require('firebase/app');\nrequire('firebase/auth');\nrequire('firebase/database');\n\nvar app = firebase.initializeApp({ ... });\n```\n\nIf you are using TypeScript with the npm package, you can import just the\nservices you use:\n\n```js\n// This import loads the firebase namespace along with all its type information.\nimport * as firebase from 'firebase/app';\n\n// These imports load individual services into the firebase namespace.\nimport 'firebase/auth';\nimport 'firebase/database';\n```\n\n_The type information from the import statement will include all of the SDKs,\nnot just the ones you have `required`, so you could get a runtime error if you\nreference a non-required service._\n\n## Get the code (Node.js - server and command line)\n\n### NPM\n\nWhile you can write entire Firebase applications without any backend code, many\ndevelopers want to write server applications or command-line utilities using the\nNode.js JavaScript runtime.\n\nYou can use the same npm module to use Firebase in the Node.js runtime (on a\nserver or running from the command line):\n\n```\n$ npm init\n$ npm install --save firebase\n```\n\nIn your code, you can access Firebase using:\n\n```js\nvar firebase = require('firebase');\nvar app = firebase.initializeApp({ ... });\n// ...\n```\n\nIf you are using native ES6 module with --experimental-modules flag, you should do:\n\n```js\n// This import loads the firebase namespace.\nimport firebase from 'firebase/app';\n\n// These imports load individual services into the firebase namespace.\nimport 'firebase/auth';\nimport 'firebase/database';\n```\n\n_Known issue for typescript users with --experimental-modules: you have to set allowSyntheticDefaultImports to true in tsconfig.json to pass the type check. Use it with caution since it makes the assumption that all modules have a default export, which might not be the case for the other dependencies you have. And Your code will break if you try to import the default export from a module that doesn't have default export._\n\n\nFirebase Storage is not included in the server side Firebase npm module.\nInstead, you can use the\n[`google-cloud` Node.js client](https://github.com/GoogleCloudPlatform/google-cloud-node).\n\n```\n$ npm install --save google-cloud\n```\n\nIn your code, you can access your Storage bucket using:\n\n```js\nvar gcloud = require('google-cloud')({ ... });\nvar gcs = gcloud.storage();\nvar bucket = gcs.bucket('<your-firebase-storage-bucket>');\n...\n```\n\nFirebase Cloud Messaging is not included in the server side Firebase npm module.\nInstead, you can use the\n[Firebase Cloud Messaging Rest API](https://firebase.google.com/docs/cloud-messaging/send-message).\n\n## API definition\n\nIf you use the\n[Closure Compiler](https://developers.google.com/closure/compiler/) or\ncompatible IDE, you can find API definitions for all the Firebase JavaScript API\nin the included `/externs` directory in this package:\n\n```\nexterns/\n firebase-app-externs.js\n firebase-auth-externs.js\n firebase-database-externs.js\n firebase-firestore-externs.js\n firebase-storage-externs.js\n firebase-messaging-externs.js\n```\n\n## Changelog\n\nThe Firebase changelog can be found at\n[firebase.google.com](https://firebase.google.com/support/release-notes/js).\n\n## Browser/environment compatibility\n\nSee [ENVIRONMENTS.md](ENVIRONMENTS.md) to see which browsers/environments are\nsupported for each feature.\n",
+ "readmeFilename": "README.md",
"repository": {
"type": "git",
"url": "git+https://github.com/firebase/firebase-js-sdk.git"
diff --git a/AVS/node_modules/multer/package.json b/AVS/node_modules/multer/package.json
index aa26b21..4350c30 100644
--- a/AVS/node_modules/multer/package.json
+++ b/AVS/node_modules/multer/package.json
@@ -6,14 +6,14 @@
"_location": "/multer",
"_phantomChildren": {},
"_requested": {
- "type": "tag",
- "registry": true,
- "raw": "multer",
- "name": "multer",
"escapedName": "multer",
+ "fetchSpec": "latest",
+ "name": "multer",
+ "raw": "multer",
"rawSpec": "",
+ "registry": true,
"saveSpec": null,
- "fetchSpec": "latest"
+ "type": "tag"
},
"_requiredBy": [
"#USER",
@@ -69,21 +69,24 @@
"files": [
"LICENSE",
"index.js",
- "storage/",
- "lib/"
+ "lib/",
+ "storage/"
],
"homepage": "https://github.com/expressjs/multer#readme",
"keywords": [
+ "express",
"form",
- "post",
- "multipart",
"form-data",
"formdata",
- "express",
- "middleware"
+ "middleware",
+ "multipart",
+ "post"
],
"license": "MIT",
"name": "multer",
+ "optionalDependencies": {},
+ "readme": "# Multer [![Build Status](https://travis-ci.org/expressjs/multer.svg?branch=master)](https://travis-ci.org/expressjs/multer) [![NPM version](https://badge.fury.io/js/multer.svg)](https://badge.fury.io/js/multer) [![js-standard-style](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat)](https://github.com/feross/standard)\n\nMulter is a node.js middleware for handling `multipart/form-data`, which is primarily used for uploading files. It is written\non top of [busboy](https://github.com/mscdex/busboy) for maximum efficiency.\n\n**NOTE**: Multer will not process any form which is not multipart (`multipart/form-data`).\n\n## Translations \n\nThis README is also available in other languages:\n\n- [简体中文](https://github.com/expressjs/multer/blob/master/doc/README-zh-cn.md) (Chinese)\n- [한국어](https://github.com/expressjs/multer/blob/master/doc/README-ko.md) (Korean)\n- [Русский язык](https://github.com/expressjs/multer/blob/master/doc/README-ru.md) (Russian)\n\n## Installation\n\n```sh\n$ npm install --save multer\n```\n\n## Usage\n\nMulter adds a `body` object and a `file` or `files` object to the `request` object. The `body` object contains the values of the text fields of the form, the `file` or `files` object contains the files uploaded via the form.\n\nBasic usage example:\n\nDon't forget the `enctype=\"multipart/form-data\"` in your form.\n\n```html\n<form action=\"/profile\" method=\"post\" enctype=\"multipart/form-data\">\n <input type=\"file\" name=\"avatar\" />\n</form>\n```\n\n```javascript\nvar express = require('express')\nvar multer = require('multer')\nvar upload = multer({ dest: 'uploads/' })\n\nvar app = express()\n\napp.post('/profile', upload.single('avatar'), function (req, res, next) {\n // req.file is the `avatar` file\n // req.body will hold the text fields, if there were any\n})\n\napp.post('/photos/upload', upload.array('photos', 12), function (req, res, next) {\n // req.files is array of `photos` files\n // req.body will contain the text fields, if there were any\n})\n\nvar cpUpload = upload.fields([{ name: 'avatar', maxCount: 1 }, { name: 'gallery', maxCount: 8 }])\napp.post('/cool-profile', cpUpload, function (req, res, next) {\n // req.files is an object (String -> Array) where fieldname is the key, and the value is array of files\n //\n // e.g.\n // req.files['avatar'][0] -> File\n // req.files['gallery'] -> Array\n //\n // req.body will contain the text fields, if there were any\n})\n```\n\nIn case you need to handle a text-only multipart form, you should use the `.none()` method:\n\n```javascript\nvar express = require('express')\nvar app = express()\nvar multer = require('multer')\nvar upload = multer()\n\napp.post('/profile', upload.none(), function (req, res, next) {\n // req.body contains the text fields\n})\n```\n\n## API\n\n### File information\n\nEach file contains the following information:\n\nKey | Description | Note\n--- | --- | ---\n`fieldname` | Field name specified in the form |\n`originalname` | Name of the file on the user's computer |\n`encoding` | Encoding type of the file |\n`mimetype` | Mime type of the file |\n`size` | Size of the file in bytes |\n`destination` | The folder to which the file has been saved | `DiskStorage`\n`filename` | The name of the file within the `destination` | `DiskStorage`\n`path` | The full path to the uploaded file | `DiskStorage`\n`buffer` | A `Buffer` of the entire file | `MemoryStorage`\n\n### `multer(opts)`\n\nMulter accepts an options object, the most basic of which is the `dest`\nproperty, which tells Multer where to upload the files. In case you omit the\noptions object, the files will be kept in memory and never written to disk.\n\nBy default, Multer will rename the files so as to avoid naming conflicts. The\nrenaming function can be customized according to your needs.\n\nThe following are the options that can be passed to Multer.\n\nKey | Description\n--- | ---\n`dest` or `storage` | Where to store the files\n`fileFilter` | Function to control which files are accepted\n`limits` | Limits of the uploaded data\n`preservePath` | Keep the full path of files instead of just the base name\n\nIn an average web app, only `dest` might be required, and configured as shown in\nthe following example.\n\n```javascript\nvar upload = multer({ dest: 'uploads/' })\n```\n\nIf you want more control over your uploads, you'll want to use the `storage`\noption instead of `dest`. Multer ships with storage engines `DiskStorage`\nand `MemoryStorage`; More engines are available from third parties.\n\n#### `.single(fieldname)`\n\nAccept a single file with the name `fieldname`. The single file will be stored\nin `req.file`.\n\n#### `.array(fieldname[, maxCount])`\n\nAccept an array of files, all with the name `fieldname`. Optionally error out if\nmore than `maxCount` files are uploaded. The array of files will be stored in\n`req.files`.\n\n#### `.fields(fields)`\n\nAccept a mix of files, specified by `fields`. An object with arrays of files\nwill be stored in `req.files`.\n\n`fields` should be an array of objects with `name` and optionally a `maxCount`.\nExample:\n\n```javascript\n[\n { name: 'avatar', maxCount: 1 },\n { name: 'gallery', maxCount: 8 }\n]\n```\n\n#### `.none()`\n\nAccept only text fields. If any file upload is made, error with code\n\"LIMIT\\_UNEXPECTED\\_FILE\" will be issued.\n\n#### `.any()`\n\nAccepts all files that comes over the wire. An array of files will be stored in\n`req.files`.\n\n**WARNING:** Make sure that you always handle the files that a user uploads.\nNever add multer as a global middleware since a malicious user could upload\nfiles to a route that you didn't anticipate. Only use this function on routes\nwhere you are handling the uploaded files.\n\n### `storage`\n\n#### `DiskStorage`\n\nThe disk storage engine gives you full control on storing files to disk.\n\n```javascript\nvar storage = multer.diskStorage({\n destination: function (req, file, cb) {\n cb(null, '/tmp/my-uploads')\n },\n filename: function (req, file, cb) {\n cb(null, file.fieldname + '-' + Date.now())\n }\n})\n\nvar upload = multer({ storage: storage })\n```\n\nThere are two options available, `destination` and `filename`. They are both\nfunctions that determine where the file should be stored.\n\n`destination` is used to determine within which folder the uploaded files should\nbe stored. This can also be given as a `string` (e.g. `'/tmp/uploads'`). If no\n`destination` is given, the operating system's default directory for temporary\nfiles is used.\n\n**Note:** You are responsible for creating the directory when providing\n`destination` as a function. When passing a string, multer will make sure that\nthe directory is created for you.\n\n`filename` is used to determine what the file should be named inside the folder.\nIf no `filename` is given, each file will be given a random name that doesn't\ninclude any file extension.\n\n**Note:** Multer will not append any file extension for you, your function\nshould return a filename complete with an file extension.\n\nEach function gets passed both the request (`req`) and some information about\nthe file (`file`) to aid with the decision.\n\nNote that `req.body` might not have been fully populated yet. It depends on the\norder that the client transmits fields and files to the server.\n\n#### `MemoryStorage`\n\nThe memory storage engine stores the files in memory as `Buffer` objects. It\ndoesn't have any options.\n\n```javascript\nvar storage = multer.memoryStorage()\nvar upload = multer({ storage: storage })\n```\n\nWhen using memory storage, the file info will contain a field called\n`buffer` that contains the entire file.\n\n**WARNING**: Uploading very large files, or relatively small files in large\nnumbers very quickly, can cause your application to run out of memory when\nmemory storage is used.\n\n### `limits`\n\nAn object specifying the size limits of the following optional properties. Multer passes this object into busboy directly, and the details of the properties can be found on [busboy's page](https://github.com/mscdex/busboy#busboy-methods).\n\nThe following integer values are available:\n\nKey | Description | Default\n--- | --- | ---\n`fieldNameSize` | Max field name size | 100 bytes\n`fieldSize` | Max field value size (in bytes) | 1MB\n`fields` | Max number of non-file fields | Infinity\n`fileSize` | For multipart forms, the max file size (in bytes) | Infinity\n`files` | For multipart forms, the max number of file fields | Infinity\n`parts` | For multipart forms, the max number of parts (fields + files) | Infinity\n`headerPairs` | For multipart forms, the max number of header key=>value pairs to parse | 2000\n\nSpecifying the limits can help protect your site against denial of service (DoS) attacks.\n\n### `fileFilter`\n\nSet this to a function to control which files should be uploaded and which\nshould be skipped. The function should look like this:\n\n```javascript\nfunction fileFilter (req, file, cb) {\n\n // The function should call `cb` with a boolean\n // to indicate if the file should be accepted\n\n // To reject this file pass `false`, like so:\n cb(null, false)\n\n // To accept the file pass `true`, like so:\n cb(null, true)\n\n // You can always pass an error if something goes wrong:\n cb(new Error('I don\\'t have a clue!'))\n\n}\n```\n\n## Error handling\n\nWhen encountering an error, Multer will delegate the error to Express. You can\ndisplay a nice error page using [the standard express way](http://expressjs.com/guide/error-handling.html).\n\nIf you want to catch errors specifically from Multer, you can call the\nmiddleware function by yourself. Also, if you want to catch only [the Multer errors](https://github.com/expressjs/multer/blob/master/lib/multer-error.js), you can use the `MulterError` class that is attached to the `multer` object itself (e.g. `err instanceof multer.MulterError`).\n\n```javascript\nvar multer = require('multer')\nvar upload = multer().single('avatar')\n\napp.post('/profile', function (req, res) {\n upload(req, res, function (err) {\n if (err instanceof multer.MulterError) {\n // A Multer error occurred when uploading.\n } else if (err) {\n // An unknown error occurred when uploading.\n }\n\n // Everything went fine.\n })\n})\n```\n\n## Custom storage engine\n\nFor information on how to build your own storage engine, see [Multer Storage Engine](https://github.com/expressjs/multer/blob/master/StorageEngine.md).\n\n## License\n\n[MIT](LICENSE)\n",
+ "readmeFilename": "README.md",
"repository": {
"type": "git",
"url": "git+https://github.com/expressjs/multer.git"
diff --git a/AVS/routes/index.js b/AVS/routes/index.js
index bdbdd09..15a3e99 100644
--- a/AVS/routes/index.js
+++ b/AVS/routes/index.js
@@ -5,7 +5,7 @@ var router = express.Router();
router.get('/', function(req, res, next) {
console.log("hello");
- res.render('index', { title: 'NITK Video Streaming App' });
+ res.render('index', { title: 'NITK Video Streaming App'} );
});
router.post('/search', function(req, res){
diff --git a/AVS/routes/search.js b/AVS/routes/search.js
index 5d169f4..cdc1925 100644
--- a/AVS/routes/search.js
+++ b/AVS/routes/search.js
@@ -21,7 +21,7 @@ const firebaseConfig = {
firebase.initializeApp(firebaseConfig);
router.get('/:uname', function(req, res, next) {
- res.render('search',{uname: req.params.uname});
+ res.render('search',{uname: req.params.uname,title: 'Search'});
});
var list_names=[]
@@ -59,8 +59,9 @@ router.get('/search_results/:query', function(req, res, next) {
});
}
-
-res.render('search_results', { query: qr, result: results });
+console.log(qr);
+console.log(results);
+res.render('search_results', { query: qr, result: results,title: 'Search Query' });
});
module.exports = router;
diff --git a/AVS/views/error.hbs b/AVS/views/error.hbs
deleted file mode 100644
index 0659765..0000000
--- a/AVS/views/error.hbs
+++ /dev/null
@@ -1,3 +0,0 @@
-<h1>{{message}}</h1>
-<h2>{{error.status}}</h2>
-<pre>{{error.stack}}</pre>
diff --git a/AVS/views/index.hbs b/AVS/views/index.hbs
deleted file mode 100644
index 153da27..0000000
--- a/AVS/views/index.hbs
+++ /dev/null
@@ -1,7 +0,0 @@
-
-<h1>Welcome to {{title}}</h1>
-<form action="/search" method="post">
-Enter Username:
-<input type="text" name="username" value="Username"><br><br>
- <input type="submit" value="Submit">
-</form>
\ No newline at end of file
diff --git a/AVS/views/layout.hbs b/AVS/views/layout.hbs
deleted file mode 100644
index 068eb6b..0000000
--- a/AVS/views/layout.hbs
+++ /dev/null
@@ -1,10 +0,0 @@
-<!DOCTYPE html>
-<html>
- <head>
- <title>{{title}}</title>
- <link rel='stylesheet' href='/stylesheets/style.css' />
- </head>
- <body>
- {{{body}}}
- </body>
-</html>
diff --git a/AVS/views/search.hbs b/AVS/views/search.hbs
deleted file mode 100644
index 690739c..0000000
--- a/AVS/views/search.hbs
+++ /dev/null
@@ -1,7 +0,0 @@
-<h1> Welcome {{uname}}! <h1>
-
-<form action = "/search/search_results" method = "POST">
- <input type="text" name="Search" value="Search">
- <input type="submit" value="Submit">
-</form>
-
diff --git a/AVS/views/search_results.hbs b/AVS/views/search_results.hbs
deleted file mode 100644
index 13fede0..0000000
--- a/AVS/views/search_results.hbs
+++ /dev/null
@@ -1,27 +0,0 @@
-<h1> Search Results for Query: {{query}}</h1>
-<div>
-<h2> {{result.[0].name}} </h2>
-<br>
-<p> {{result.[0].tags}} </p>
-<br><br>
-
-<h2> {{result.[1].name}} </h2>
-<br>
-<p> {{result.[1].tags}} </p>
-<br><br>
-
-<h2> {{result.[2].name}} </h2>
-<br>
-<p> {{result.[2].tags}} </p>
-<br><br>
-
-<h2> {{result.[3].name}} </h2>
-<br>
-<p> {{result.[3].tags}} </p>
-<br><br>
-
-<h2> {{result.[4].name}} </h2>
-<br>
-<p> {{result.[4].tags}} </p>
-<br><br>
-</div>