470 B
470 B
description, tags
| description | tags |
|---|---|
| Implements the infrastructure for reading and writing to URIs | meta |
Implementation
-- Virtual page (uri:URI)
virtualPage.define {
pattern = "uri:.+",
run = function(path)
local uri = path:sub(#"uri:"+1)
return net.readURI(uri .. ".md", {encoding="text/markdown"})
end
}
service.define {
selector = "net.readURI:https:*",
match = {},
run = function(data)
return net.proxyFetch(data.uri).body
end
}