Unify deed titles, character identity and household specialist appointments

This commit is contained in:
unimatrix 2026-11-17 02:33:17 +00:00
commit 4a16f5c083

View file

@ -55,9 +55,9 @@ export function createApplication(db,settings={}) {
if(Object.hasOwn(publicModeration,url.pathname))return request.method==='GET'?publicModeration[url.pathname]():new Response('Method not allowed',{status:405});
if(url.pathname.startsWith('/memorial/')||['/memorial.css','/memorial.js'].includes(url.pathname))return memorials(request);
if(url.pathname.startsWith('/api/public/clans/'))return publicClans(request);
if(/^\/clans\/[a-z0-9]{2,6}\/?$/i.test(url.pathname)||['/clan-public.css','/clan-public.js','/clan-dynasty.js','/clan-dynasty.css','/dune-date.js'].includes(url.pathname)){
if(/^\/clans\/[a-z0-9]{2,6}\/?$/i.test(url.pathname)||['/clan-public.css','/clan-public.js','/clan-dynasty.js','/dynastic-address.mjs','/clan-dynasty.css','/dune-date.js'].includes(url.pathname)){
if(!['GET','HEAD'].includes(request.method))return new Response('Method not allowed',{status:405});
const asset=url.pathname.startsWith('/clans/')?'clan.html':url.pathname.slice(1),shared={'clan-dynasty.js':'clan-dynasty.mjs','clan-dynasty.css':'clan-dynasty.css','dune-date.js':'dune-date.mjs'};
const asset=url.pathname.startsWith('/clans/')?'clan.html':url.pathname.slice(1),shared={'dynastic-address.mjs':'dynastic-address.mjs','clan-dynasty.js':'clan-dynasty.mjs','clan-dynasty.css':'clan-dynasty.css','dune-date.js':'dune-date.mjs'};
const content=request.method==='HEAD'?null:await readFile(shared[asset]?new URL('../control-panel/public/'+shared[asset],import.meta.url):new URL(asset,root));
return new Response(asset==='clan.html'&&content?content.toString().replace('<!--SHARED_HEADER-->',SHARED_HEADER):content,{headers:{...security,'Content-Type':(asset.endsWith('.html')?'text/html':asset.endsWith('.css')?'text/css':'text/javascript')+'; charset=utf-8','Cache-Control':'no-store'}});
}