diff --git a/README.md b/README.md index 5b3cbde..1b91027 100644 --- a/README.md +++ b/README.md @@ -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) diff --git a/images/image.png b/images/image.png new file mode 100644 index 0000000..0e214a1 Binary files /dev/null and b/images/image.png differ diff --git a/package-lock.json b/package-lock.json index 8fd6f69..e5e7068 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,5 +1,5 @@ { - "name": "sdp-request-watcher", + "name": "Dashboard", "lockfileVersion": 3, "requires": true, "packages": { diff --git a/src/server.js b/src/server.js index 925bc2c..9e7c620 100644 --- a/src/server.js +++ b/src/server.js @@ -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}`); }); \ No newline at end of file