forked from scality/cloudserver
-
Notifications
You must be signed in to change notification settings - Fork 0
/
pfsserver.js
29 lines (26 loc) · 827 Bytes
/
pfsserver.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
'use strict'; // eslint-disable-line strict
const arsenal = require('arsenal');
const { config } = require('./lib/Config.js');
const logger = require('./lib/utilities/logger');
const pfsServer = new arsenal.network.rest.RESTServer({
bindAddress: config.pfsDaemon.bindAddress,
port: config.pfsDaemon.port,
dataStore: new arsenal.storage.data.file.DataFileStore({
dataPath: config.pfsDaemon.dataPath,
log: config.log,
noSync: config.pfsDaemon.noSync,
noCache: config.pfsDaemon.noCache,
isPassthrough: true,
isReadOnly: config.pfsDaemon.isReadOnly,
}),
log: config.log,
});
pfsServer.setup(err => {
if (err) {
logger.error('Error initializing REST pfsServer', {
error: err,
});
return;
}
pfsServer.start();
});