-
Notifications
You must be signed in to change notification settings - Fork 83
/
core_api.js
27 lines (22 loc) · 872 Bytes
/
core_api.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
// Configure logger
if (process.env.NODE_ENV === "production") require("./configs/logger");
// Configure modules
var restify = require('restify');
var environment = process.env.NODE_ENV || 'development';
// Configure globals
GLOBAL.appConfig = require("./configs/config");
GLOBAL.wallets = require('./configs/wallets');
GLOBAL.db = require('./models/index');
GLOBAL.queue = require('./lib/queue/index');
// Setup express
var server = restify.createServer();
server.use(restify.bodyParser());
var port = process.env.PORT || 6000;
server.listen(process.env.PORT || 6000, function(){
console.log("Coinnext Core API is running on port %d in %s mode", port, environment);
});
// Routes
require('./routes/core_api/wallets')(server);
require('./routes/core_api/transactions')(server);
require('./routes/core_api/trade')(server);
require('./routes/core_api/stats')(server);