-
Notifications
You must be signed in to change notification settings - Fork 11
/
index.js
98 lines (73 loc) · 3.36 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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
express = require('express');//call express module
request = require('request');// call the request module
path = require('path');// call the path modeule
config = require('./config');
ccapi = require('./routes/ccapi');
interval = require('./routes/interval');
//Build other app variables
port = 3000;
app = express();
//MAIN PAGE
app.use('/', express.static(path.join(__dirname, 'html')));
//BASIC COMMANDS CCAPI
app.get('/connect', ccapi.connect);
//CAMERA INFO
app.get('/deviceinfo', ccapi.getDeviceInfo);
//DEVICE STATUS
app.get('/storage', ccapi.getDeviceStatusStorage);
app.get('/currentstorage', ccapi.getDeviceStatusCurrStorage);
app.get('/currentdirectory', ccapi.getDeviceStatusCurrDirectory);
app.get('/battery', ccapi.getDeviceStatusBattery);
app.get('/batterylist', ccapi.getDeviceStatusBatteryList);
app.get('/lens', ccapi.getDeviceStatusLens);
app.get('/temperature', ccapi.getDeviceStatusTemp);
//CAMERA SETTINGS
app.get('/copyright', ccapi.getCopyright);
app.get('/putcopyright/:copyrightInfo', ccapi.putCopyright);
app.get('/deletecopyright', ccapi.delCopyright);
app.get('/author', ccapi.getAuthor);
app.get('/author/:authorInfo', ccapi.putAuthor);
app.get('/deleteauthor', ccapi.delAuthor);
app.get('/ownername', ccapi.getOwner);
app.get('/ownername/:ownerInfo', ccapi.putOwner);
app.get('/deleteownername', ccapi.delOwner);
app.get('/nickname', ccapi.getNickname);
app.get('/nickname/:nicknameInfo', ccapi.putNickname);
app.get('/deletenickname', ccapi.delNickname);
app.get('/datetime', ccapi.getDatetime);
app.get('/datetime/:datetimeInfo/:DST', ccapi.putDatetime);
app.get('/cardformat/:storagename', ccapi.postCardFormat);
app.get('/beep', ccapi.getBeep);
app.get('/beep/:ability', ccapi.putBeep);
app.get('/displayoff', ccapi.getDisplayoff);
app.get('/displayoff/:ability', ccapi.putDisplayoff);
app.get('/autopoweroff', ccapi.getAutopoweroff);
app.get('/autopoweroff/:ability', ccapi.putAutopoweroff);
app.get('/networkconnection/:action', ccapi.postNetworkconnection); //Doesn't support Wi-Fi
app.get('/networksetting', ccapi.getNetworksetting); //List of network APIs
//Skipping other calls for network setting for now.
app.get('/wificonnection', ccapi.postWificonnection);
app.get('/wifisetting', ccapi.getWifisetting);
//Skipping other call for WiFi setting for now.
//CAMERA CUSTOMIZATION
app.get('/exposure', ccapi.getExposure); //Exposure compensation
app.get('/exposure/av', ccapi.getExposureAV);
app.get('/exposure/tv', ccapi.getExposureTV);
app.get('/flashexposure', ccapi.getFlashExposure); //Flash exposure compensation
app.get('/isoincrements', ccapi.getIsoIncrements); // ISO increments
//IMAGE OPERATIONS
app.get('/contents', ccapi.getContents); //Get list of storage URLs
app.get('/contents/:storage', ccapi.getContentsStorage); //Get list of storage URLs
app.get('/contents/:storage/:directory', ccapi.getContentsDirectory); //Get list of contents URLs
app.get('/deletecontents/:storage/:directory', ccapi.delContentsDirectory); //Delete directory
app.get('/contents/:storage/:directory/:file/:kind', ccapi.getFile); //Get list of contents URLs
//BASIC COMMANDS INTERVAL
app.use('/status', interval.getStatus);
app.use('/test', interval.test);
//INTERVAL SHOOTING
app.use('/interval/:shots/:wait/:delay', interval.intervalShooting);
app.use('/interval/stop', interval.stopInterval);
//SETUP THE APP
app.listen(port, function(){
console.log('Listening on port 3000...');
});