aboutsummaryrefslogtreecommitdiff
path: root/packages/integrations/vercel/test/fixtures/middleware-with-edge-file/src/middleware.js
blob: cf085321c8e6810415d04246263c6257db264d45 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
export const hello = async () => 'hello world';

const message = await hello();

/**
 * @type {import("astro").MiddlewareResponseHandler}
 */
export const onRequest = async (context, next) => {
	const test = 'something';
	context.cookies.set('foo', 'bar');
	const response = await next();
	response.headers.set('x-message', message);	
	return response;
};