forked from glennsp/com.mill
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapi.js
More file actions
33 lines (32 loc) · 742 Bytes
/
api.js
File metadata and controls
33 lines (32 loc) · 742 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
29
30
31
32
33
// eslint-disable-next-line import/no-unresolved
const Homey = require('homey');
module.exports = [
{
method: 'POST',
path: '/authenticate',
fn: async (args, callback) => {
try {
const result = await Homey.app.authenticate(args.body.username, args.body.password);
return callback(null, result);
} catch (error) {
return callback(error);
}
}
},
{
method: 'POST',
path: '/clearSettings',
fn: async (args, callback) => {
Homey.app.clear();
return callback(null, {});
}
},
{
method: 'POST',
path: '/clearLog',
fn: async (args, callback) => {
Homey.ManagerSettings.set('debugLog', []);
return callback(null, {});
}
}
];