小编sta*_*acy的帖子

无法使用 bodyParser 获取请求正文

我正在构建一个 NextJS React 应用程序。在我的 server/index.tsx 中,我得到:

import next from 'next';
import express from 'express';
import compression from 'compression';
import bodyParser from 'body-parser';
import { parse } from 'url';
import { createServer as createHttpServer } from 'http';
import { ParsedUrlQuery } from 'querystring';

const port = 9000;
const dev = process.env.NODE_ENV !== 'production';
const nextApp = next({ dev });

const handleNextRequests = nextApp.getRequestHandler();

/**
 * Compression setup
 */
const shouldCompress = (
  req: express.Request,
  res: express.Response
): boolean => {
  // …
Run Code Online (Sandbox Code Playgroud)

fetch express typescript body-parser next.js

4
推荐指数
1
解决办法
1万
查看次数

标签 统计

body-parser ×1

express ×1

fetch ×1

next.js ×1

typescript ×1