---
title: enableFrameworkExt
---

# server.enableFrameworkExt

- **Type:** `boolean`
- **Default:** `false`

By default, when the [custom Web Server feature](/guides/advanced-features/web-server) is enabled, the Middleware will use the Modern.js's syntax.

Enabling `server.enableFrameworkExt` allows the use of syntax extensions from other frameworks.

```ts title="modern.config.ts"
export default defineConfig({
  server: {
    enableFrameworkExt: true,
  },
});
```

## Example

Default usage:

```ts title="server/index.ts"
import { Middleware } from '@modern-js/runtime/server';

export const middleware: Middleware = (ctx, next) => {
  console.log(ctx.request.url);
  next();
};
```

After enabling it, the Middleware type will be exported from other namespaces, and syntax extensions from frameworks can be used:

```ts title="server/index.ts"
import { SomeType } from '@modern-js/runtime/{namespace}';

export const middleware: SomeType = (...args) => {
  console.log(args[0].url);
  next();
};
```

:::note
The above code is pseudocode, and the specific usage needs to refer to the corresponding framework extension.

:::
