Browse Source

more project stuff

develop
Rob Colbert 2 years ago
parent
commit
a1c189836f
  1. 2
      app/views/index.pug
  2. 7
      countdown.js
  3. 7
      package.json
  4. 13
      supervisor/countdown-timer.conf

2
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

7
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);

7
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"
}

13
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
Loading…
Cancel
Save