forked from giovortu/node-flashair-v2
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlib.js
More file actions
28 lines (23 loc) · 650 Bytes
/
lib.js
File metadata and controls
28 lines (23 loc) · 650 Bytes
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
/**
* Project : flashair2
* Component : FileTransferService
* Author : Giovanni Ortu
* eMail : giovanni.ortu@abinsula.com
* Module name : Library
* Description :
*/
// default
var APPNAME = 'flashair'
var APPMODE = 'STA' // or AP or IPT
var Libs = require('./libs')
var hostname = require('os').hostname()
module.exports = function (appname, appmode) {
// API End-point
var endpoint = appname || APPNAME
APPMODE = appmode || APPMODE
// add .local for Mac
if (APPMODE === 'STA' && hostname !== 'local' && hostname.split('.').slice(-1)[0] === 'local') {
endpoint += '.local'
}
return new Libs(endpoint)
}