Open czweb2017 opened 6 years ago
You should let nginx or apache serve static file instead of nodejs. Link: https://hashnode.com/post/why-is-it-not-recommended-to-serve-static-files-from-nodejs-ciibz8flv01duj3xt4lxuomp3
Well, it was resolved. Please use '/css/index.css' on IMG or LINK elements. Don't lose '/' as begain.
Document struct: static/img/1.jpg src/view src/routes/index.js
Static file: app.use(staticServe('static/'));
Router path: router.get('/aaa/bbb', () => { blabla... ctx.render(.......) })
But, I get a wrong path result on front end: 'http://localhost:8888/aaa/1.jpg' 404
HELP!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!