Initial support for static files
This commit is contained in:
		
							parent
							
								
									e40b453118
								
							
						
					
					
						commit
						bc2a428432
					
				|  | @ -1,4 +1,5 @@ | |||
| import prologue | ||||
| import prologue/middlewares/staticfile | ||||
| import templating | ||||
| 
 | ||||
| proc getIndex*(ctx: Context) {.async.} = | ||||
|  | @ -8,10 +9,11 @@ proc runWebsite(settings: Table) = | |||
|   let prologueSettings = newSettings( | ||||
|     debug = settings["debug"] | ||||
|   ) | ||||
|   let website = newApp(settings = prologueSettings) | ||||
|   var website = newApp(settings = prologueSettings) | ||||
| 
 | ||||
|   website.get("/", getIndex) | ||||
| 
 | ||||
|   website.use(staticFileMiddleware("static")) | ||||
|   website.run() | ||||
| 
 | ||||
| export runWebsite | ||||
|  |  | |||
|  | @ -1,8 +1,11 @@ | |||
| <html> | ||||
|   <head> | ||||
|     <title>Example</title> | ||||
|     <style rel="stylesheet" href="/static/css/master.css"></style> | ||||
|   </head> | ||||
|   <body> | ||||
|     <div> | ||||
|       {% block content %}{% endblock %} | ||||
|     </div> | ||||
|   </body> | ||||
| </html> | ||||
|  |  | |||
|  | @ -0,0 +1 @@ | |||
|  /* Nothing here yet */ | ||||
		Loading…
	
		Reference in New Issue