-
Notifications
You must be signed in to change notification settings - Fork 0
/
astro.config.mjs
37 lines (35 loc) · 1.02 KB
/
astro.config.mjs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import { defineConfig } from "astro/config";
import preact from "@astrojs/preact";
import react from "@astrojs/react";
import vercelStatic from "@astrojs/vercel/static";
import sitemap from "@astrojs/sitemap";
// https://astro.build/config
export default defineConfig({
integrations: [
// Enable Preact to support Preact JSX components.
preact(),
// Enable React for the Algolia search component.
react(),
sitemap(),
],
site: `https://www.sybline.com`,
output: "static",
adapter: vercelStatic({
analytics: true,
}),
server: {
middleware: {
// Example middleware to block a certain user agent
async apply(server) {
server.use((req, res, next) => {
const userAgent = req.headers['user-agent'];
const blockedUserAgent = 'Bytespider';
if (userAgent.includes(blockedUserAgent)) {
return res.status(403).send('Forbidden');
}
next();
});
},
},
},
});