How to install base in Koa for static files?

I have a web application that is served from

somedomain.com/ MyApp /

What is the best way to configure it in koa so as not to accept the part (myapp /) for serving static content in your account?

+4
source share
1 answer

You can use koa-mount to mount koa-static middleware on a specific path, for example:

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

Source: https://habr.com/ru/post/1691047/


All Articles