From 7b753d06c47cd2489717e4ff2af96bdb38a0e7c9 Mon Sep 17 00:00:00 2001 From: pan <1029559041@qq.com> Date: Thu, 8 Oct 2020 23:07:59 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app.js b/app.js index 240e51b..b4a0b17 100644 --- a/app.js +++ b/app.js @@ -20,8 +20,9 @@ app.use(express.json()); app.use(express.urlencoded({ extended: false })); app.use(cookieParser()); app.use(express.static(path.join(__dirname, 'public'))); + app.use(cors({ - origin:['http://localhost:5000'], + origin:[process.env.webClient], credentials:true })) app.use('/', indexRouter);