Static file support
This commit is contained in:
parent
46b5593cb3
commit
a284657783
3 changed files with 8 additions and 0 deletions
|
@ -6,6 +6,7 @@ target :lib do
|
|||
check "lib" # Directory name
|
||||
# ignore "lib/templates/*.rb"
|
||||
|
||||
library "fileutils"
|
||||
# library "pathname" # Standard libraries
|
||||
# library "strong_json" # Gems
|
||||
# library "phlex"
|
||||
|
|
|
@ -17,6 +17,12 @@ class Phlexite::Router
|
|||
File::write(out, component.call)
|
||||
end
|
||||
|
||||
def mount(local_directory, on:)
|
||||
out = full_out_path(on)
|
||||
FileUtils::mkdir_p out
|
||||
FileUtils::cp_r File::join(local_directory, "."), out
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def full_out_path(out_path)
|
||||
|
|
|
@ -8,6 +8,7 @@ module Phlexite
|
|||
def initialize: (String, Site) -> void
|
||||
def page: (String, untyped) -> void
|
||||
def group: (String) { (Router) -> void } -> void
|
||||
def mount: (String, on: String) -> void
|
||||
|
||||
private
|
||||
def full_out_path: (String) -> String
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue