diff --git a/script.js b/js/playfield.js similarity index 100% rename from script.js rename to js/playfield.js diff --git a/server.js b/server.js index c9762ed..ecc0599 100644 --- a/server.js +++ b/server.js @@ -19,11 +19,17 @@ const server = http.createServer((req, res) => { 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'); + case 'js': + switch (pathParts[2] || "") { + case 'playfield.js': + sendFile(res, 'js/playfield.js', 'application/javascript'); + break; + case 'interact.js': + sendFile(res, 'interact.js', 'application/javascript'); + break; + default: + send404(res, uri); + } break; case 'deck': if (pathParts.length === 3) { @@ -89,8 +95,8 @@ function sendPlayfield(res, deckName) { const html = ` - - + +