Move client js to 'js' subfolder, rename script.js to playfield.js
This commit is contained in:
parent
3c2190b940
commit
e48059ac82
14
server.js
14
server.js
@ -19,12 +19,18 @@ const server = http.createServer((req, res) => {
|
|||||||
case 'style.css':
|
case 'style.css':
|
||||||
sendFile(res, 'style.css', 'text/css');
|
sendFile(res, 'style.css', 'text/css');
|
||||||
break;
|
break;
|
||||||
case 'script.js':
|
case 'js':
|
||||||
sendFile(res, 'script.js', 'application/javascript');
|
switch (pathParts[2] || "") {
|
||||||
|
case 'playfield.js':
|
||||||
|
sendFile(res, 'js/playfield.js', 'application/javascript');
|
||||||
break;
|
break;
|
||||||
case 'interact.js':
|
case 'interact.js':
|
||||||
sendFile(res, 'interact.js', 'application/javascript');
|
sendFile(res, 'interact.js', 'application/javascript');
|
||||||
break;
|
break;
|
||||||
|
default:
|
||||||
|
send404(res, uri);
|
||||||
|
}
|
||||||
|
break;
|
||||||
case 'deck':
|
case 'deck':
|
||||||
if (pathParts.length === 3) {
|
if (pathParts.length === 3) {
|
||||||
let deckName = pathParts[2];
|
let deckName = pathParts[2];
|
||||||
@ -89,8 +95,8 @@ function sendPlayfield(res, deckName) {
|
|||||||
const html = `
|
const html = `
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<script src="/interact.js"></script>
|
<script src="/js/interact.js"></script>
|
||||||
<script src="/script.js"></script>
|
<script src="/js/playfield.js"></script>
|
||||||
<link rel="stylesheet" type="text/css" href="/style.css">
|
<link rel="stylesheet" type="text/css" href="/style.css">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
Loading…
Reference in New Issue
Block a user