-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
57 lines (53 loc) · 1.62 KB
/
index.js
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
//var express = require('express');
//var mongoose = require('mongoose');
//var fallback = require('express-history-api-fallback');
//var connect = require('connect');
//var app = express();
//var root = __dirname + './';
//
//app.use(express.static(root));
//app.use(fallback(__dirname + './index.html'));
//
//
//
//
//var http = require('http').Server(app);
//var io = require('socket.io')(http);
//mongoose.connect('mongodb://andrisole92:[email protected]:41128/heroku_fwpj43xj');
//var db_conn = mongoose.connection;
//var db = require('./db')(db_conn,mongoose,io);
//var sockets = require('./sockets')(io);
//
//
//
//
//app.use('/dist', express.static('dist'));
//app.use(express.static('./dist'));
//
//app.get('*', function(req, res){
// res.sendFile(__dirname + '/index.html');
//});
//
//http.listen(3000, function(){
// console.log('listening on *:3000');
//});
var requirejs = require('requirejs');
requirejs.config({
baseUrl: './www_server',
//except, if the module ID starts with "app",
//load it from the js/app directory. paths
//config is relative to the baseUrl, and
//never includes a ".js" extension since
//the paths config could be for a directory.
paths: {
//app: 'www_server'
},
//Pass the top-level main.js/index.js require
//function to requirejs so that node modules
//are loaded relative to the top-level JS file.
nodeRequire: require
});
requirejs(['app','io','http','socket.io','db'],function(app, io, http, socketio,db) {
console.log("index.js module loaded");
//app.listen(3000);
});