Move client js to 'js' subfolder, rename script.js to playfield.js
This commit is contained in:
parent
3c2190b940
commit
e48059ac82
20
server.js
20
server.js
@ -19,11 +19,17 @@ 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] || "") {
|
||||||
break;
|
case 'playfield.js':
|
||||||
case 'interact.js':
|
sendFile(res, 'js/playfield.js', 'application/javascript');
|
||||||
sendFile(res, 'interact.js', 'application/javascript');
|
break;
|
||||||
|
case 'interact.js':
|
||||||
|
sendFile(res, 'interact.js', 'application/javascript');
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
send404(res, uri);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case 'deck':
|
case 'deck':
|
||||||
if (pathParts.length === 3) {
|
if (pathParts.length === 3) {
|
||||||
@ -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