forked from maheshiv/grievances-server
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserver.js
More file actions
executable file
·38 lines (35 loc) · 883 Bytes
/
Copy pathserver.js
File metadata and controls
executable file
·38 lines (35 loc) · 883 Bytes
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
'use strict';
/**
* # snowflake
* Snowflake 
*/
/**
* Hapi will be the NodeJS server.
* I figure if WalMart, the largest retailer in the world, uses it,
* it will work for me.
*
* From the command line, run ```npm start```
*
* Hapi is configured in this import
*/
var HapiServer = require('./src/config/hapi');
/**
* The mongodb will be used to store all the users
*/
require('./src/database/mongodb');
//Handle static files
HapiServer.route({
method: 'GET',
path: '/uploads/{filename}',
handler: {
file: function (request) {
return 'uploads/'+request.params.filename;
}
}
});
/**
* When hapi starts up, some info is displayed
*/
HapiServer.start(function () {
console.log('Server is running: ' + HapiServer.info.uri);
});