Skip to content

How to serve static files #307

Description

@rrenode
Project Tree
|- prologueTest.nim
|- public
    \- a.html
import prologue
import prologue/middlewares/staticfile

proc hello*(ctx: Context) {.async.} =
  resp "<h1>Hello, Prologue!</h1>"

var app = newApp()
app.use(staticFileMiddleware("public"))
app.addRoute("/", hello)
app.run()

Based on the docs I'd assume http://127.0.0.1:8080/a.html would serve but it doesn't. I've tried http://127.0.0.1:8080/public/a.html which is also 404.

Am I doing something wrong?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions