Express static mount path in krakenjs

116 Views Asked by At

I am trying to find the equivalent config.json file entry in krakenjs for the below code.

 app.use("/app/static", express.static(path.join(__dirname, 'public'), {maxage: '2h'}));

I tried something like the below. But, it didn't pick the mounted path

"static": {
      "enabled": true,
      "priority": 40,
      "name": "server-static",
      "module": {
        "arguments": [
          "path:./public",
          {"maxAge" : "3h"},
          "mountpath:/app/static"
        ]
      }
    }

I am unable to access it with the following URL : https://app.com/app/static/style.css. But, it is accessible via https://app.com/app/style.css

Note: /app is my requestURI.

1

There are 1 best solutions below

0
Murali L On

I figured out. Here is how it is configured.

"static": {
  "enabled": true,
  "priority": 40,
  "name": "server-static",
  "module": {
    "arguments": [
      "path:./public",
      {"maxAge" : "3h"}
    ]
  },
  "route": "/static"
},