Original open-world wuxia browser RPG: - Graphical 48px tile world (12 locations) with walkable character, NPC interaction, action spots, roaming enemies, travel portals - Tactical 10x7 grid battles: shapes, statuses, internals, 30+ techniques incl. tier-V ultimates & support arts across 6 weapon types - Full equipment: weapon/head/body/feet/2 accessories, 5 tiers, smithing - 6-chapter main story + side jobs board + bounty hunts + tournament - Crafting (smith/alchemy), fishing minigame, gambling, pickpocketing - Companions with chemistry passives, affection, romance, sects - Achievements, monster codex, day/night cycle, endings - 25-test headless smoke suite; no-cache static server included
23 lines
1.1 KiB
JavaScript
23 lines
1.1 KiB
JavaScript
/* zero-dependency static server with aggressive no-caching */
|
|
const http = require('http');
|
|
const fs = require('fs');
|
|
const path = require('path');
|
|
const ROOT = __dirname;
|
|
const MIME = { '.html': 'text/html; charset=utf-8', '.js': 'text/javascript; charset=utf-8', '.css': 'text/css; charset=utf-8', '.png': 'image/png', '.ico': 'image/x-icon', '.json': 'application/json' };
|
|
http.createServer((req, res) => {
|
|
let p = decodeURIComponent((req.url || '/').split('?')[0]);
|
|
if (p === '/') p = '/index.html';
|
|
const file = path.normalize(path.join(ROOT, p));
|
|
if (!file.startsWith(ROOT)) { res.writeHead(403); return res.end(); }
|
|
fs.readFile(file, (err, data) => {
|
|
if (err) { res.writeHead(404, { 'Cache-Control': 'no-store' }); return res.end('not found'); }
|
|
res.writeHead(200, {
|
|
'Content-Type': MIME[path.extname(file)] || 'application/octet-stream',
|
|
'Cache-Control': 'no-store, no-cache, must-revalidate',
|
|
'Pragma': 'no-cache',
|
|
'Expires': '0'
|
|
});
|
|
res.end(data);
|
|
});
|
|
}).listen(8917, '127.0.0.1', () => console.log('wulin serving on http://127.0.0.1:8917 (no-store)'));
|