Merge branch 'vite-404' into 'main'

vite: add mock api, return 404s

See merge request soapbox-pub/soapbox!2918
This commit is contained in:
Alex Gleason 2024-01-12 23:33:27 +00:00
commit 75f5331942

View file

@ -92,6 +92,19 @@ export default defineConfig(({ command }) => ({
filename: 'report.html',
title: 'Soapbox Bundle',
}),
{
name: 'mock-api',
configureServer(server) {
server.middlewares.use((req, res, next) => {
if (/^\/api\//.test(req.url!)) {
res.statusCode = 404;
res.end('Not Found');
} else {
next();
}
});
},
},
],
resolve: {
alias: [