dev #2
12
README.md
12
README.md
@ -1,8 +1,9 @@
|
|||||||
# sdp-request-watcher
|
# sdp-request-watcher
|
||||||
|
|
||||||
|
|
||||||
# Setup
|
## Setup
|
||||||
env.example contains the setup for the env requires a Non-Browser Application key from https://api-console.zoho.com/add
|
env.example contains the setup for the env requires a Non-Browser Application key from https://api-console.zoho.com/add
|
||||||
|
Place the .env file inside the src directory
|
||||||
|
|
||||||
Technicians and Statuses are checked in the .env file
|
Technicians and Statuses are checked in the .env file
|
||||||
|
|
||||||
@ -11,6 +12,15 @@ I resolved the issue with it only finding closed tickets so it should now find r
|
|||||||
The technician field can have spaces after the comma however the statuses can not. There can be no spaces before the status or it wont work properly.
|
The technician field can have spaces after the comma however the statuses can not. There can be no spaces before the status or it wont work properly.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
## Examples
|
||||||
|

|
||||||
|
|
||||||
|
|
||||||
|
## Requirements
|
||||||
|
axios
|
||||||
|
dotenv
|
||||||
|
|
||||||
## Reference Materials
|
## Reference Materials
|
||||||
|
|
||||||
- [Non-Browser Apps - Overview](https://www.zoho.com/accounts/protocol/oauth/limited-input-devices.html)
|
- [Non-Browser Apps - Overview](https://www.zoho.com/accounts/protocol/oauth/limited-input-devices.html)
|
||||||
|
|||||||
BIN
images/image.png
Normal file
BIN
images/image.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 89 KiB |
2
package-lock.json
generated
2
package-lock.json
generated
@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"name": "sdp-request-watcher",
|
"name": "Dashboard",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
|
|||||||
@ -7,7 +7,7 @@ const { createBoardService } = require('./boardService');
|
|||||||
const { createRoutes } = require('./routes');
|
const { createRoutes } = require('./routes');
|
||||||
|
|
||||||
const { CLIENT_ID, CLIENT_SECRET, TECHNICIAN_NAMES, STATUS_NAMES } = process.env;
|
const { CLIENT_ID, CLIENT_SECRET, TECHNICIAN_NAMES, STATUS_NAMES } = process.env;
|
||||||
const PORT = process.env.PORT || 3000; // change to 3000 after done testing using 3001 as I have a second server running to make sure it functions correctly
|
const PORT = process.env.PORT || 3000; // default 3000
|
||||||
|
|
||||||
if (!CLIENT_ID || !CLIENT_SECRET) {
|
if (!CLIENT_ID || !CLIENT_SECRET) {
|
||||||
console.error('Client id and secret missing from .env');
|
console.error('Client id and secret missing from .env');
|
||||||
@ -18,10 +18,12 @@ const technicians = (TECHNICIAN_NAMES ? TECHNICIAN_NAMES.split(',') : []).map(t
|
|||||||
const statuses = (STATUS_NAMES ? STATUS_NAMES.split(',') : []).map(s => s.trim()).filter(Boolean);
|
const statuses = (STATUS_NAMES ? STATUS_NAMES.split(',') : []).map(s => s.trim()).filter(Boolean);
|
||||||
const statusSet = new Set(statuses.map(s => s.toLowerCase()));
|
const statusSet = new Set(statuses.map(s => s.toLowerCase()));
|
||||||
|
|
||||||
const WINDOW_MINUTES = 10;
|
const WINDOW_MINUTES = 10; // how far back the server looks in minutes
|
||||||
const CHECK_MINUTES = 1;
|
const CHECK_MINUTES = 1; // how often the server checks for new tickets in minutes
|
||||||
|
|
||||||
const app = express();
|
const app = express();
|
||||||
|
|
||||||
|
//creates the board service with the config specified
|
||||||
const boardService = createBoardService({
|
const boardService = createBoardService({
|
||||||
clientId: CLIENT_ID,
|
clientId: CLIENT_ID,
|
||||||
clientSecret: CLIENT_SECRET,
|
clientSecret: CLIENT_SECRET,
|
||||||
@ -35,6 +37,7 @@ app.use(express.static(path.join(__dirname, 'public')));
|
|||||||
|
|
||||||
app.use('/api', createRoutes(boardService));
|
app.use('/api', createRoutes(boardService));
|
||||||
|
|
||||||
|
//starts listening on port specified
|
||||||
app.listen(PORT, () => {
|
app.listen(PORT, () => {
|
||||||
console.log(`Open http://localhost:${PORT}`);
|
console.log(`Open http://localhost:${PORT}`);
|
||||||
});
|
});
|
||||||
Loading…
Reference in New Issue
Block a user