File-based response support & static server
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
- Clean up UniversalPath implementation
- Use Readable/Writable types correctly for stream methods
- Add .list() methods for getting child files
- Make Response body specify explicit types and support
writing Readable streams to the body
- Create a static file server that supports directory listing
This commit is contained in:
45
src/resources/views/static/dirlist.pug
Normal file
45
src/resources/views/static/dirlist.pug
Normal file
@@ -0,0 +1,45 @@
|
||||
doctype html
|
||||
html
|
||||
head
|
||||
title Index of #{dirname}
|
||||
style.
|
||||
body {
|
||||
font-family: Arial, sans-serif;
|
||||
}
|
||||
|
||||
table {
|
||||
border-collapse: collapse;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
td, th {
|
||||
border: 1px solid #dddddd;
|
||||
text-align: left;
|
||||
padding: 8px;
|
||||
}
|
||||
|
||||
tr:nth-child(even) {
|
||||
background-color: #dddddd;
|
||||
}
|
||||
body
|
||||
h1 Directory Listing
|
||||
h2 #{dirname}
|
||||
table
|
||||
tr
|
||||
th Name
|
||||
th Type
|
||||
th Size
|
||||
tr
|
||||
td 📂
|
||||
a(href='..') ..
|
||||
td Directory
|
||||
td -
|
||||
each entry in contents
|
||||
tr
|
||||
td #{entry.isDirectory ? '📂 ' : ''}
|
||||
a(href='./' + entry.name) #{entry.name}
|
||||
td #{entry.isDirectory ? 'Directory' : 'File'}
|
||||
td #{entry.size}
|
||||
if !config('server.poweredBy.hide', false)
|
||||
hr
|
||||
small retrieved at #{(new Date).toDateString()} #{(new Date).toTimeString()} | powered by <a href="https://extollo.garrettmills.dev/" target="_blank">Extollo</a>
|
||||
Reference in New Issue
Block a user