From a1c189836f1a60fa87fab40915ab9bffcefa633d Mon Sep 17 00:00:00 2001 From: Rob Colbert Date: Tue, 9 Aug 2022 14:04:55 -0400 Subject: [PATCH] more project stuff --- app/views/index.pug | 2 +- countdown.js | 7 +++++-- package.json | 7 ++++++- supervisor/countdown-timer.conf | 13 +++++++++++++ 4 files changed, 25 insertions(+), 4 deletions(-) create mode 100644 supervisor/countdown-timer.conf diff --git a/app/views/index.pug b/app/views/index.pug index bd5d55c..62a6937 100644 --- a/app/views/index.pug +++ b/app/views/index.pug @@ -4,7 +4,7 @@ block content h1 Create Stream Countdown Timer form(method="POST", action="/").uk-form .uk-margin - input(id="show-title", name="title", type="text", placeholder="Enter show title", autocomplete="show-title").uk-input + input(id="show-title", name="title", type="text", placeholder="Enter show title", autocomplete="organization").uk-input .uk-text-small.uk-text-muted Plese enter the name of your show. .uk-margin input(id="show-url", name="url", type="text", placeholder="Enter show url").uk-input diff --git a/countdown.js b/countdown.js index 9a19427..94ddfa4 100644 --- a/countdown.js +++ b/countdown.js @@ -1,3 +1,7 @@ +// countdown.js +// Copyright (C) 2022 DTP Technologies, LLC +// License: Apache-2.0 + 'use strict'; require('dotenv').config(); @@ -10,7 +14,6 @@ const multer = require('multer'); module.postCreateCountdown = async (req, res, next) => { const date = req.body.date.split('-'); const time = req.body.time.split(':'); - res.locals.params = { show: { title: req.body.title, @@ -56,7 +59,7 @@ module.getHomeView = async (req, res) => { const upload = multer(); module.app.post('/', upload.none(), module.postCreateCountdown); - + module.app.get('/timer', module.getTimerView); module.app.get('/', module.getHomeView); diff --git a/package.json b/package.json index cce9459..ba30dcc 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,8 @@ { "main": "countdown.js", + "scripts": { + "start": "node countdown.js" + }, "dependencies": { "dotenv": "^16.0.1", "express": "^4.18.1", @@ -8,5 +11,7 @@ "numeral": "^2.0.6", "pug": "^3.0.2", "uikit": "^3.15.1" - } + }, + "license": "Apache-2.0", + "author": "DTP Technologies, LLC" } diff --git a/supervisor/countdown-timer.conf b/supervisor/countdown-timer.conf new file mode 100644 index 0000000..54d5f2e --- /dev/null +++ b/supervisor/countdown-timer.conf @@ -0,0 +1,13 @@ +[program:countdown] +numprocs=1 +process_name=%(program_name)s_%(process_num)02d +command=/home/dtp/bin/node --optimize_for_size --max_old_space_size=1024 --gc_interval=100 countdown.js +directory=/home/dtp/live/dtp-countdown-timer +autostart=true +autorestart=true +startretries=3 +stopsignal=INT +stderr_logfile=/var/log/dtp/countdown-timer.err.log +stdout_logfile=/var/log/dtp/countdown-timer.out.log +user=dtp +environment=HOME='/home/dtp/live/dtp-countdown-timer',NODE_ENV=production,LOGNAME=countdown