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
TypeError: anywhere is not a function
at C:\Users\LENOVO\Pictures\mainan\corsany\api\index.js:14:30
at new Promise ()
at C:\Users\LENOVO\Pictures\mainan\corsany\api\index.js:11:9
at Object. (C:\Users\LENOVO\Pictures\mainan\corsany\api\index.js:18:3)
at Module._compile (node:internal/modules/cjs/loader:1376:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1435:10)
at Module.load (node:internal/modules/cjs/loader:1207:32)
at Module._load (node:internal/modules/cjs/loader:1023:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:135:12)
at node:internal/main/run_main_module:28:49
C:\Users\LENOVO\Pictures\mainan\corsany\api\index.js:14
.use('/cors-anywhere', anywhere())
^
TypeError: anywhere is not a function
at C:\Users\LENOVO\Pictures\mainan\corsany\api\index.js:14:30
at new Promise ()
at C:\Users\LENOVO\Pictures\mainan\corsany\api\index.js:11:9
at Object. (C:\Users\LENOVO\Pictures\mainan\corsany\api\index.js:18:3)
at Module._compile (node:internal/modules/cjs/loader:1376:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1435:10)
at Module.load (node:internal/modules/cjs/loader:1207:32)
at Module._load (node:internal/modules/cjs/loader:1023:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:135:12)
at node:internal/main/run_main_module:28:49
code
const express = require('express');
const axios = require('axios');
const { json } = require('body-parser');
const anywhere = require('express-cors-anywhere');
const { PORT } = process.env;
const port = PORT || 3000;
(async () => {
/* configure cors */
await new Promise(resolve =>
express()
.use(json())
.use('/cors-anywhere', anywhere())
.get('/hello', (_, res) => res.status(200).send('Hi!'))
.listen(port, resolve)
);
})();
The text was updated successfully, but these errors were encountered: