diff --git a/backend/index.js b/backend/index.js index fbdf410..1be5eb0 100644 --- a/backend/index.js +++ b/backend/index.js @@ -1,45 +1,22 @@ -import crypto from 'crypto' - -const APP_CONSTANTS = { - EVENTTYPES: { - HBPING : 1, - HBPONG : 2, - STREAM_JOIN : 3, - STREAM_LEAVE : 4, - EVENTPAIR_RESP: 5, - EVENTSUB_MSG : 6, - }, -} - -const make_kvsafe_stable_key_for_ns = function (str_ns, x) { - const hash = crypto.createHash('md5').update(x).digest('hex') - const out_key = str_ns + ':' + hash - return out_key -} - -const PAGE_TITLE = Bun.env['PAGE_TITLE'] - -const POLLING_SLEEP_MAINLOOP = 1000 - -const async_build_js_script = async (path_js_entry_script, build_options) => { +const async_build_js_script = async function (path_js_entry_script, build_options) { const result = await Bun.build({ entrypoints: [ path_js_entry_script ], - ...build_options, env: 'disable', minify: false, + ...build_options, }) const str_out = await result.outputs[0].text() return str_out } -const get_siteroot_html = function () {return ` +const get_siteroot_html = function ({ page_title }) {return ` - ${PAGE_TITLE} + ${page_title || 'Page Title'}