I'd like to serve /mbti/:lang/ with static files from directory ./mbti/:lang/.
That is:
/mbti/en/ -> ./mbti/en/index.html
/mbti/en/some.json -> ./mbti/en/some.json
I found static, but seems like it can't do this:
app.use('/mbti/:lang/', express.static(__dirname + '/mbti/' + :lang));
How can I implement this? thanks.
You shouldn't need to do that, just make /mbti/ a static route and anything below that root will be served as static
express.static(__dirname + '/mbti');