Home / File/ integration-middleware-post.js — astro Source File

integration-middleware-post.js — astro Source File

Architecture documentation for integration-middleware-post.js, a javascript file in the astro codebase. 1 imports, 0 dependents.

Entity Profile

Dependency Diagram

graph LR
  ec2d359d_30c1_509c_ac7d_6ea3aa0dae9c["integration-middleware-post.js"]
  3a7a7ff7_6c64_95f9_af85_4deb518834f1["astro:middleware"]
  ec2d359d_30c1_509c_ac7d_6ea3aa0dae9c --> 3a7a7ff7_6c64_95f9_af85_4deb518834f1
  style ec2d359d_30c1_509c_ac7d_6ea3aa0dae9c fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

import { defineMiddleware } from 'astro:middleware';

export const onRequest = defineMiddleware((context, next) => {
	if (context.url.pathname === '/integration-post') {
		return new Response(JSON.stringify({ post: 'works' }), {
			headers: {
				'content-type': 'application/json',
			},
		});
	}
	
	if (context.url.pathname === '/does-not-exist') {
		return context.rewrite('/rewrite');
	}

	return next();
});

Subdomains

Functions

Dependencies

  • astro:middleware

Frequently Asked Questions

What does integration-middleware-post.js do?
integration-middleware-post.js is a source file in the astro codebase, written in javascript. It belongs to the IntegrationAdapters domain, SsrAdapters subdomain.
What functions are defined in integration-middleware-post.js?
integration-middleware-post.js defines 1 function(s): onRequest.
What does integration-middleware-post.js depend on?
integration-middleware-post.js imports 1 module(s): astro:middleware.
Where is integration-middleware-post.js in the architecture?
integration-middleware-post.js is located at packages/astro/test/fixtures/middleware space/integration-middleware-post.js (domain: IntegrationAdapters, subdomain: SsrAdapters, directory: packages/astro/test/fixtures/middleware space).

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free