// jshint node:true // jshint esversion:6 "use strict"; const http = require('http'), qs = require('querystring'), fs = require('fs'), url = require('url'), https = require('https'), port = 8080; const deckName = "the_Unholy_Priest_update_2"; const server = http.createServer((req, res) => { const uri = url.parse(req.url); if (req.method === 'POST') { handlePost(res, req, uri); } else { switch( uri.pathname ) { case '/': case '/index.html': sendIndex(res, ""); break; case '/style.css': sendFile(res, 'style.css', 'text/css'); break; case '/script.js': sendFile(res, 'script.js', 'application/javascript'); break; case '/interact.js': sendFile(res, 'interact.js', 'application/javascript'); break; case '/' + deckName + '.png': sendFile(res, deckName + '.png', 'image/png'); break; case '/' + deckName + '.json': sendFile(res, deckName + '.json', 'application/json'); break; default: res.writeHead(404, {'Content-type': "text/html; charset=utf-8"}); const html = `