express-file-index
Version:
A simple file index middleware for Express that serves static files and shows a browser for directories.
56 lines • 1.76 kB
HTML
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>404 Not Found</title>
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap" rel="stylesheet">
<link href="?expressFileIndexAsset=base.css" rel="stylesheet">
</head>
<body>
<script>
const setColorMode = () => {
const isDarkMode = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches;
document.body.dataset.colorMode = isDarkMode ? 'dark' : 'light';
};
setColorMode();
window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', setColorMode);
</script>
<div id="main">
<div class="container">
<h1>404</h1>
<p>The resource you're trying to access can't be found.</p>
<div>
<a href="/" class="btn secondary">Go home</a>
</div>
</div>
</div>
<style>
body {
margin: 0px;
padding: 0px;
}
h1 {
font-size: 32px;
border: 0px;
margin: 0px;
}
#main {
position: absolute;
display: flex;
width: 100%;
height: 100%;
}
.container {
text-align: center;
margin: auto;
display: flex;
flex-direction: column;
align-items: center;
gap: 8px;
}
</style>
</body>
</html>