Stepan Suvorov
Stepan Suvorov

Reputation: 26206

How to set base in Koa for static files?

I have a web-app that is served from

somedomain.com/myapp/

what is the best way to setup it in koa not to take in account base part (myapp/) for serving static content?

Upvotes: 2

Views: 1214

Answers (1)

Oles Savluk
Oles Savluk

Reputation: 4345

You can use koa-mount to mount koa-static middleware to a specific path, like this:

app.use(mount('/some-prefix', serve('./static')));

Upvotes: 4

Related Questions