You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
./pages/api/[...all].ts:13:10
Type error: This expression is not callable.
Type 'typeof import("/Users/joeyoung/_WORKING/joegyoung/node_modules/next-http-proxy-middleware/src/index")' has no call signatures.
11 | } = req;
12 |
> 13 | return httpProxyMiddleware(req, res, {
| ^
14 | // You can use the `http-proxy` option
15 | target: `http://localhost:9000/.netlify/functions/${all}`,
16 | pathRewrite: {
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
This is the source
import { NextApiRequest, NextApiResponse } from "next";
import httpProxyMiddleware from "next-http-proxy-middleware";
const isDevelopment = process.env.NODE_ENV === "development";
const isProduction = process.env.NODE_ENV === "production";
export default (req: NextApiRequest, res: NextApiResponse) => {
if (isDevelopment) {
const {
query: { all },
} = req;
return httpProxyMiddleware(req, res, {
// You can use the `http-proxy` option
target: `http://localhost:9000/.netlify/functions/${all}`,
pathRewrite: {
"^/api+": "",
},
});
} else {
res.status(404).send(null);
}
};
What am I needing to do?
The text was updated successfully, but these errors were encountered:
I am getting error with my page
This is the source
What am I needing to do?
The text was updated successfully, but these errors were encountered: