Hello, I've tried deploying a trivial app to Heroku.

I've used the Heroku Buildpack for Nim: 
[https://github.com/vic/heroku-buildpack-nim](https://github.com/vic/heroku-buildpack-nim)

On my local machine, Jester serves static files (css, ico, etc.) without a 
problem.

I can deploy the app to Heroku. But **Jester doesn 't serve the static files on 
Heroku (403: Forbidden)**.

Static files are readable by others 
([https://github.com/dom96/jester#static-files)](https://github.com/dom96/jester#static-files\)).

Deploy here: 
[https://ancient-scrubland-31142.herokuapp.com](https://ancient-scrubland-31142.herokuapp.com)/

Project structure: 
    
    
    .
    ├── nim_heroku.nimble
    ├── Procfile
    ├── src
    │   ├── nim_heroku
    │   ├── nim_heroku.nim
    │   └── views
    │       └── general.nim
    ├── static_dir
    │   ├── favicon.ico
    │   └── style.css
    └── tags
    
    3 directories, 8 files
    
    
    
    Run

Bin file (src/nim_heroku.nim): 
    
    
    import jester, asyncdispatch, os, strutils
    import views/general
    
    var settings = newSettings()
    
    if existsEnv("PORT"):
      settings.port = Port(parseInt(getEnv("PORT")))
    
    settings.staticDir = "./static_dir"
    
    routes:
      get "/":
        resp renderMain()
    
    runForever()
    
    
    Run

View file/HTML file (src/views/general.nim): 
    
    
    #? stdtmpl(subsChar = '$', metaChar = '#')
    #
    #proc renderMain*(): string =
    #  result = ""
    <!DOCTYPE html>
    <html>
      <head>
        <title>Nim Heroku Test</title>
        <link rel="stylesheet" 
href="https://unpkg.com/modern-css-reset/dist/reset.min.css"; />
        <link rel="stylesheet" type="text/css" href="style.css">
        <link rel="shortcut icon" href="favicon.ico">
      </head>
      <body>
        <div class="center text-center">
          <div class="[ flow ]">
            <p>Hello World</p>
            <p>This is a test</p>
          </div>
        </div>
      </body>
    </html>
    #end proc
    
    
    Run

Thanks for your help.

Reply via email to