A full-stack Node.js app (Vue frontend, Express backend, MongoDB storage).
MONGODB_CONNECTION=...
cd ./backend
npm run dev
devServer: {
proxy: 'http://localhost:8000'
}
cd ./client
npm run serve
cd ./backend
rm -rf dist
cd ../client
npm run build
cp -r dist/ ../backend
app.use(express.static(
path.resolve(
__dirname, '../dist'),
{ maxAge: '1y', etag: false }
)
);
Frontend and backend are hosted on single server now.