-
Notifications
You must be signed in to change notification settings - Fork 47
/
index.js
38 lines (35 loc) · 1 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
// Copyright 2015, EMC, Inc.
"use strict";
var di = require('di'),
_ = require('lodash'),
core = require('on-core')(di),
injector = new di.Injector(
_.flatten([
core.injectables,
core.helper.requireGlob(__dirname + '/lib/**/*.js')
])
),
core = injector.get('Services.Core'),
configuration = injector.get('Services.Configuration'),
Logger = injector.get('Logger'),
logger = Logger.initialize('Dhcp'),
Server = injector.get('DHCP.Proxy.Server');
core.start()
.then(function() {
Server.create(
configuration.get('dhcpProxyBindPort', 4011),
{
LegacyPort: configuration.get('dhcpProxyOutPort', 68),
EFIPort: configuration.get('dhcpProxyEFIOutPort', 4011)
},
configuration.get('dhcpProxyBindAddress', '0.0.0.0')
).start();
})
.catch(function(e) {
logger.critical("Error starting server", {
error: e
});
process.nextTick(function() {
process.exit(1);
});
});