Updated the readme to give more detailed setup and added a few comments to the server.js to describe the editable values.

This commit is contained in:
Isaac 2026-07-27 14:34:27 -04:00
parent 14bc03be93
commit bccee24f19
4 changed files with 18 additions and 5 deletions

View File

@ -1,8 +1,9 @@
# 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
Place the .env file inside the src directory
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.
## Examples
![alt text](images/image.png)
## Requirements
axios
dotenv
## Reference Materials
- [Non-Browser Apps - Overview](https://www.zoho.com/accounts/protocol/oauth/limited-input-devices.html)

BIN
images/image.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 89 KiB

2
package-lock.json generated
View File

@ -1,5 +1,5 @@
{
"name": "sdp-request-watcher",
"name": "Dashboard",
"lockfileVersion": 3,
"requires": true,
"packages": {

View File

@ -7,7 +7,7 @@ const { createBoardService } = require('./boardService');
const { createRoutes } = require('./routes');
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) {
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 statusSet = new Set(statuses.map(s => s.toLowerCase()));
const WINDOW_MINUTES = 10;
const CHECK_MINUTES = 1;
const WINDOW_MINUTES = 10; // how far back the server looks in minutes
const CHECK_MINUTES = 1; // how often the server checks for new tickets in minutes
const app = express();
//creates the board service with the config specified
const boardService = createBoardService({
clientId: CLIENT_ID,
clientSecret: CLIENT_SECRET,
@ -35,6 +37,7 @@ app.use(express.static(path.join(__dirname, 'public')));
app.use('/api', createRoutes(boardService));
//starts listening on port specified
app.listen(PORT, () => {
console.log(`Open http://localhost:${PORT}`);
});