{"compiled":"\"use strict\";\nconst {Fragment: _Fragment, jsx: _jsx, jsxs: _jsxs} = arguments[0];\nfunction _createMdxContent(props) {\n  const _components = {\n    code: \"code\",\n    figure: \"figure\",\n    h2: \"h2\",\n    p: \"p\",\n    pre: \"pre\",\n    span: \"span\",\n    ...props.components\n  }, {Box, TabItem, Tabs} = _components;\n  if (!Box) _missingMdxReference(\"Box\", true);\n  if (!TabItem) _missingMdxReference(\"TabItem\", true);\n  if (!Tabs) _missingMdxReference(\"Tabs\", true);\n  return _jsxs(_Fragment, {\n    children: [_jsx(Box, {\n      type: \"warning\",\n      title: \"Under development\",\n      children: _jsx(_components.p, {\n        children: \"The middleware below is still under development. If the middleware becomes stable in the\\nfuture, it will be merged into the core module.\"\n      })\n    }), \"\\n\", _jsx(_components.h2, {\n      children: \"Usage\"\n    }), \"\\n\", _jsxs(_components.p, {\n      children: [\"Add the middleware to the \", _jsx(_components.code, {\n        children: \"options.middlewares\"\n      }), \" array in the config file.\"]\n    }), \"\\n\", _jsx(_components.h2, {\n      children: \"Parse Body\"\n    }), \"\\n\", _jsx(_components.p, {\n      children: \"This middleware parses the body received from the request and provides it with a context.\"\n    }), \"\\n\", _jsxs(Tabs, {\n      children: [_jsx(TabItem, {\n        id: \"Config\",\n        children: _jsx(_components.figure, {\n          \"data-rehype-pretty-code-figure\": \"\",\n          children: _jsx(_components.pre, {\n            tabIndex: \"0\",\n            \"data-language\": \"ts\",\n            \"data-theme\": \"material-theme-palenight github-light\",\n            children: _jsxs(_components.code, {\n              \"data-language\": \"ts\",\n              \"data-theme\": \"material-theme-palenight github-light\",\n              style: {\n                display: \"grid\"\n              },\n              children: [_jsxs(_components.span, {\n                \"data-line\": \"\",\n                children: [_jsx(_components.span, {\n                  style: {\n                    \"--shiki-dark\": \"#89DDFF\",\n                    \"--shiki-dark-font-style\": \"italic\",\n                    \"--shiki-light\": \"#D73A49\",\n                    \"--shiki-light-font-style\": \"inherit\"\n                  },\n                  children: \"import\"\n                }), _jsx(_components.span, {\n                  style: {\n                    \"--shiki-dark\": \"#89DDFF\",\n                    \"--shiki-light\": \"#24292E\"\n                  },\n                  children: \" {\"\n                }), _jsx(_components.span, {\n                  style: {\n                    \"--shiki-dark\": \"#BABED8\",\n                    \"--shiki-light\": \"#24292E\"\n                  },\n                  children: \" defineConfig\"\n                }), _jsx(_components.span, {\n                  style: {\n                    \"--shiki-dark\": \"#89DDFF\",\n                    \"--shiki-light\": \"#24292E\"\n                  },\n                  children: \" }\"\n                }), _jsx(_components.span, {\n                  style: {\n                    \"--shiki-dark\": \"#89DDFF\",\n                    \"--shiki-dark-font-style\": \"italic\",\n                    \"--shiki-light\": \"#D73A49\",\n                    \"--shiki-light-font-style\": \"inherit\"\n                  },\n                  children: \" from\"\n                }), _jsx(_components.span, {\n                  style: {\n                    \"--shiki-dark\": \"#89DDFF\",\n                    \"--shiki-light\": \"#032F62\"\n                  },\n                  children: \" '\"\n                }), _jsx(_components.span, {\n                  style: {\n                    \"--shiki-dark\": \"#C3E88D\",\n                    \"--shiki-light\": \"#032F62\"\n                  },\n                  children: \"@zely-js/zely\"\n                }), _jsx(_components.span, {\n                  style: {\n                    \"--shiki-dark\": \"#89DDFF\",\n                    \"--shiki-light\": \"#032F62\"\n                  },\n                  children: \"'\"\n                }), _jsx(_components.span, {\n                  style: {\n                    \"--shiki-dark\": \"#89DDFF\",\n                    \"--shiki-light\": \"#24292E\"\n                  },\n                  children: \";\"\n                })]\n              }), \"\\n\", _jsxs(_components.span, {\n                \"data-line\": \"\",\n                children: [_jsx(_components.span, {\n                  style: {\n                    \"--shiki-dark\": \"#89DDFF\",\n                    \"--shiki-dark-font-style\": \"italic\",\n                    \"--shiki-light\": \"#D73A49\",\n                    \"--shiki-light-font-style\": \"inherit\"\n                  },\n                  children: \"import\"\n                }), _jsx(_components.span, {\n                  style: {\n                    \"--shiki-dark\": \"#89DDFF\",\n                    \"--shiki-light\": \"#24292E\"\n                  },\n                  children: \" {\"\n                }), _jsx(_components.span, {\n                  style: {\n                    \"--shiki-dark\": \"#BABED8\",\n                    \"--shiki-light\": \"#24292E\"\n                  },\n                  children: \" bodyMiddleware\"\n                }), _jsx(_components.span, {\n                  style: {\n                    \"--shiki-dark\": \"#89DDFF\",\n                    \"--shiki-light\": \"#24292E\"\n                  },\n                  children: \" }\"\n                }), _jsx(_components.span, {\n                  style: {\n                    \"--shiki-dark\": \"#89DDFF\",\n                    \"--shiki-dark-font-style\": \"italic\",\n                    \"--shiki-light\": \"#D73A49\",\n                    \"--shiki-light-font-style\": \"inherit\"\n                  },\n                  children: \" from\"\n                }), _jsx(_components.span, {\n                  style: {\n                    \"--shiki-dark\": \"#89DDFF\",\n                    \"--shiki-light\": \"#032F62\"\n                  },\n                  children: \" '\"\n                }), _jsx(_components.span, {\n                  style: {\n                    \"--shiki-dark\": \"#C3E88D\",\n                    \"--shiki-light\": \"#032F62\"\n                  },\n                  children: \"@zely-js/zely/middlewares\"\n                }), _jsx(_components.span, {\n                  style: {\n                    \"--shiki-dark\": \"#89DDFF\",\n                    \"--shiki-light\": \"#032F62\"\n                  },\n                  children: \"'\"\n                }), _jsx(_components.span, {\n                  style: {\n                    \"--shiki-dark\": \"#89DDFF\",\n                    \"--shiki-light\": \"#24292E\"\n                  },\n                  children: \";\"\n                })]\n              }), \"\\n\", _jsx(_components.span, {\n                \"data-line\": \"\",\n                children: \" \"\n              }), \"\\n\", _jsxs(_components.span, {\n                \"data-line\": \"\",\n                children: [_jsx(_components.span, {\n                  style: {\n                    \"--shiki-dark\": \"#89DDFF\",\n                    \"--shiki-dark-font-style\": \"italic\",\n                    \"--shiki-light\": \"#D73A49\",\n                    \"--shiki-light-font-style\": \"inherit\"\n                  },\n                  children: \"export\"\n                }), _jsx(_components.span, {\n                  style: {\n                    \"--shiki-dark\": \"#89DDFF\",\n                    \"--shiki-dark-font-style\": \"italic\",\n                    \"--shiki-light\": \"#D73A49\",\n                    \"--shiki-light-font-style\": \"inherit\"\n                  },\n                  children: \" default\"\n                }), _jsx(_components.span, {\n                  style: {\n                    \"--shiki-dark\": \"#82AAFF\",\n                    \"--shiki-light\": \"#6F42C1\"\n                  },\n                  children: \" defineConfig\"\n                }), _jsx(_components.span, {\n                  style: {\n                    \"--shiki-dark\": \"#BABED8\",\n                    \"--shiki-light\": \"#24292E\"\n                  },\n                  children: \"(\"\n                }), _jsx(_components.span, {\n                  style: {\n                    \"--shiki-dark\": \"#89DDFF\",\n                    \"--shiki-light\": \"#24292E\"\n                  },\n                  children: \"{\"\n                })]\n              }), \"\\n\", _jsxs(_components.span, {\n                \"data-line\": \"\",\n                children: [_jsx(_components.span, {\n                  style: {\n                    \"--shiki-dark\": \"#F07178\",\n                    \"--shiki-light\": \"#24292E\"\n                  },\n                  children: \"  middlewares\"\n                }), _jsx(_components.span, {\n                  style: {\n                    \"--shiki-dark\": \"#89DDFF\",\n                    \"--shiki-light\": \"#24292E\"\n                  },\n                  children: \":\"\n                }), _jsx(_components.span, {\n                  style: {\n                    \"--shiki-dark\": \"#BABED8\",\n                    \"--shiki-light\": \"#24292E\"\n                  },\n                  children: \" [bodyMiddleware]\"\n                }), _jsx(_components.span, {\n                  style: {\n                    \"--shiki-dark\": \"#89DDFF\",\n                    \"--shiki-light\": \"#24292E\"\n                  },\n                  children: \",\"\n                })]\n              }), \"\\n\", _jsxs(_components.span, {\n                \"data-line\": \"\",\n                children: [_jsx(_components.span, {\n                  style: {\n                    \"--shiki-dark\": \"#89DDFF\",\n                    \"--shiki-light\": \"#24292E\"\n                  },\n                  children: \"}\"\n                }), _jsx(_components.span, {\n                  style: {\n                    \"--shiki-dark\": \"#BABED8\",\n                    \"--shiki-light\": \"#24292E\"\n                  },\n                  children: \")\"\n                }), _jsx(_components.span, {\n                  style: {\n                    \"--shiki-dark\": \"#89DDFF\",\n                    \"--shiki-light\": \"#24292E\"\n                  },\n                  children: \";\"\n                })]\n              })]\n            })\n          })\n        })\n      }), _jsx(TabItem, {\n        id: \"Page\",\n        children: _jsx(_components.figure, {\n          \"data-rehype-pretty-code-figure\": \"\",\n          children: _jsx(_components.pre, {\n            tabIndex: \"0\",\n            \"data-language\": \"ts\",\n            \"data-theme\": \"material-theme-palenight github-light\",\n            children: _jsxs(_components.code, {\n              \"data-language\": \"ts\",\n              \"data-theme\": \"material-theme-palenight github-light\",\n              style: {\n                display: \"grid\"\n              },\n              children: [_jsxs(_components.span, {\n                \"data-line\": \"\",\n                children: [_jsx(_components.span, {\n                  style: {\n                    \"--shiki-dark\": \"#89DDFF\",\n                    \"--shiki-dark-font-style\": \"italic\",\n                    \"--shiki-light\": \"#D73A49\",\n                    \"--shiki-light-font-style\": \"inherit\"\n                  },\n                  children: \"export\"\n                }), _jsx(_components.span, {\n                  style: {\n                    \"--shiki-dark\": \"#89DDFF\",\n                    \"--shiki-dark-font-style\": \"italic\",\n                    \"--shiki-light\": \"#D73A49\",\n                    \"--shiki-light-font-style\": \"inherit\"\n                  },\n                  children: \" default\"\n                }), _jsx(_components.span, {\n                  style: {\n                    \"--shiki-dark\": \"#BABED8\",\n                    \"--shiki-light\": \"#24292E\"\n                  },\n                  children: \" [\"\n                })]\n              }), \"\\n\", _jsxs(_components.span, {\n                \"data-line\": \"\",\n                children: [_jsx(_components.span, {\n                  style: {\n                    \"--shiki-dark\": \"#82AAFF\",\n                    \"--shiki-light\": \"#6F42C1\"\n                  },\n                  children: \"  ALL\"\n                }), _jsx(_components.span, {\n                  style: {\n                    \"--shiki-dark\": \"#BABED8\",\n                    \"--shiki-light\": \"#24292E\"\n                  },\n                  children: \"(\"\n                }), _jsx(_components.span, {\n                  style: {\n                    \"--shiki-dark\": \"#89DDFF\",\n                    \"--shiki-light\": \"#24292E\"\n                  },\n                  children: \"(\"\n                }), _jsx(_components.span, {\n                  style: {\n                    \"--shiki-dark\": \"#BABED8\",\n                    \"--shiki-dark-font-style\": \"italic\",\n                    \"--shiki-light\": \"#E36209\",\n                    \"--shiki-light-font-style\": \"inherit\"\n                  },\n                  children: \"ctx\"\n                }), _jsx(_components.span, {\n                  style: {\n                    \"--shiki-dark\": \"#89DDFF\",\n                    \"--shiki-light\": \"#24292E\"\n                  },\n                  children: \")\"\n                }), _jsx(_components.span, {\n                  style: {\n                    \"--shiki-dark\": \"#C792EA\",\n                    \"--shiki-light\": \"#D73A49\"\n                  },\n                  children: \" =>\"\n                }), _jsx(_components.span, {\n                  style: {\n                    \"--shiki-dark\": \"#89DDFF\",\n                    \"--shiki-light\": \"#24292E\"\n                  },\n                  children: \" {\"\n                })]\n              }), \"\\n\", _jsxs(_components.span, {\n                \"data-line\": \"\",\n                children: [_jsx(_components.span, {\n                  style: {\n                    \"--shiki-dark\": \"#BABED8\",\n                    \"--shiki-light\": \"#24292E\"\n                  },\n                  children: \"    console\"\n                }), _jsx(_components.span, {\n                  style: {\n                    \"--shiki-dark\": \"#89DDFF\",\n                    \"--shiki-light\": \"#24292E\"\n                  },\n                  children: \".\"\n                }), _jsx(_components.span, {\n                  style: {\n                    \"--shiki-dark\": \"#82AAFF\",\n                    \"--shiki-light\": \"#6F42C1\"\n                  },\n                  children: \"log\"\n                }), _jsx(_components.span, {\n                  style: {\n                    \"--shiki-dark\": \"#F07178\",\n                    \"--shiki-light\": \"#24292E\"\n                  },\n                  children: \"(\"\n                }), _jsx(_components.span, {\n                  style: {\n                    \"--shiki-dark\": \"#BABED8\",\n                    \"--shiki-light\": \"#24292E\"\n                  },\n                  children: \"ctx\"\n                }), _jsx(_components.span, {\n                  style: {\n                    \"--shiki-dark\": \"#89DDFF\",\n                    \"--shiki-light\": \"#24292E\"\n                  },\n                  children: \".\"\n                }), _jsx(_components.span, {\n                  style: {\n                    \"--shiki-dark\": \"#BABED8\",\n                    \"--shiki-light\": \"#24292E\"\n                  },\n                  children: \"body\"\n                }), _jsx(_components.span, {\n                  style: {\n                    \"--shiki-dark\": \"#F07178\",\n                    \"--shiki-light\": \"#24292E\"\n                  },\n                  children: \")\"\n                }), _jsx(_components.span, {\n                  style: {\n                    \"--shiki-dark\": \"#89DDFF\",\n                    \"--shiki-light\": \"#24292E\"\n                  },\n                  children: \";\"\n                }), _jsx(_components.span, {\n                  style: {\n                    \"--shiki-dark\": \"#F07178\",\n                    \"--shiki-light\": \"#24292E\"\n                  },\n                  children: \" \"\n                })]\n              }), \"\\n\", _jsxs(_components.span, {\n                \"data-line\": \"\",\n                children: [_jsx(_components.span, {\n                  style: {\n                    \"--shiki-dark\": \"#89DDFF\",\n                    \"--shiki-light\": \"#24292E\"\n                  },\n                  children: \"  }\"\n                }), _jsx(_components.span, {\n                  style: {\n                    \"--shiki-dark\": \"#BABED8\",\n                    \"--shiki-light\": \"#24292E\"\n                  },\n                  children: \")\"\n                }), _jsx(_components.span, {\n                  style: {\n                    \"--shiki-dark\": \"#89DDFF\",\n                    \"--shiki-light\": \"#24292E\"\n                  },\n                  children: \",\"\n                })]\n              }), \"\\n\", _jsxs(_components.span, {\n                \"data-line\": \"\",\n                children: [_jsx(_components.span, {\n                  style: {\n                    \"--shiki-dark\": \"#BABED8\",\n                    \"--shiki-light\": \"#24292E\"\n                  },\n                  children: \"]\"\n                }), _jsx(_components.span, {\n                  style: {\n                    \"--shiki-dark\": \"#89DDFF\",\n                    \"--shiki-light\": \"#24292E\"\n                  },\n                  children: \";\"\n                }), _jsx(_components.span, {\n                  style: {\n                    \"--shiki-dark\": \"#BABED8\",\n                    \"--shiki-light\": \"#24292E\"\n                  },\n                  children: \" \"\n                })]\n              })]\n            })\n          })\n        })\n      })]\n    })]\n  });\n}\nfunction MDXContent(props = {}) {\n  const {wrapper: MDXLayout} = props.components || ({});\n  return MDXLayout ? _jsx(MDXLayout, {\n    ...props,\n    children: _jsx(_createMdxContent, {\n      ...props\n    })\n  }) : _createMdxContent(props);\n}\nreturn {\n  default: MDXContent\n};\nfunction _missingMdxReference(id, component) {\n  throw new Error(\"Expected \" + (component ? \"component\" : \"object\") + \" `\" + id + \"` to be defined: you likely forgot to import, pass, or provide it.\");\n}\n","posts":[{"overview":"Overview"},{"why-zely":"Why Zely"},{"getting-started":"Getting Started"},{"config":"Config References"},{"benchmark":"Performance"},{"troubleshooting":"Troubleshooting"},{"migration-to-dobs":"Migration to dobs"},{"routing":"Routing"},{"handler":"Handler"},{"methods":"Methods"},{"send-data":"Sending Data"},{"context":"Context"},{"page-data":"Page Data"},{"customizing-response":"Customizing Response"},{"data-fetching":"Data Fetching"},{"middleware":"Middleware"},{"auto":"Auto Importing"},{"provided-middlewares":"Provided Middlewares"},{"caching":"Caching"},{"store":"Data Caching"},{"cache":"Data Access"},{"serpack":"Serpack"},{"asset":"Asset"},{"debugging":"Debugging"},{"server-data":"Server Data"},{"frontend":"Frontend"},{"html":"HTML"},{"migration":"Migration"},{"migration-3x":"Migration from 3.x"},{"migration-2x":"Migration from 2.x"},{"community":"Community"},{"contributing":"Contributing"},{"playground":"Playground"}],"target":{"provided-middlewares":"Provided Middlewares"},"targetcategory":"Middleware","directory":"docs"}