-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathapp.js
More file actions
54 lines (43 loc) · 1.53 KB
/
app.js
File metadata and controls
54 lines (43 loc) · 1.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
'use strict';
/*
* Defining the Package
*/
var Module = require('meanio').Module;
var MeanSocket = new Module('mean-socket');
/*
* All MEAN packages require registration
* Dependency injection is used to define required modules
*/
MeanSocket.register(function(app, auth, database) {
//We enable routing. By default the Package Object is passed to the routes
MeanSocket.routes(app, auth, database);
//We are adding a link to the main menu for all authenticated users
MeanSocket.menus.add({
title: 'Mean socket help page',
link: 'Mean socket help page',
roles: ['authenticated'],
menu: 'main'
});
// //Uncomment to use. Requires meanio@0.3.7 or above
// // Save settings with callback
// // Use this for saving data from administration pages
// MeanSocket.settings({
// 'someSetting': 'some value'
// }, function(err, settings) {
// //you now have the settings object
// });
// Another save settings example this time with no callback
// This writes over the last settings.
MeanSocket.settings({
'funcPage': '../controllers/sockets',
'getMessageFunc': 'createFromSocket',
'getAllMessagesFunc': 'getAllForSocket',
'removeOldMessagesFunc': 'removeOldSocketMessages',
'getAllChannelsFunc': 'getListOfChannels'
});
// // Get settings. Retrieves latest saved settigns
// MeanSocket.settings(function(err, settings) {
// //you now have the settings object
// });
return MeanSocket;
});