Move client js to 'js' subfolder, rename script.js to playfield.js
This commit is contained in:
parent
4d514c2f37
commit
61f2851246
14
server.js
14
server.js
@ -19,12 +19,18 @@ 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');
|
||||
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) {
|
||||
let deckName = pathParts[2];
|
||||
@ -89,8 +95,8 @@ function sendPlayfield(res, deckName) {
|
||||
const html = `
|
||||
<html>
|
||||
<head>
|
||||
<script src="/interact.js"></script>
|
||||
<script src="/script.js"></script>
|
||||
<script src="/js/interact.js"></script>
|
||||
<script src="/js/playfield.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/style.css">
|
||||
</head>
|
||||
<body>
|
||||
|
Loading…
Reference in New Issue
Block a user