|
@@ -7,14 +7,14 @@ router.use(bodyParser.urlencoded({
|
|
|
router.use(bodyParser.json({ limit: '10mb' }));
|
|
|
|
|
|
|
|
|
-const allowCrossDomain = function (req, res, next) {
|
|
|
- res.header('Access-Control-Allow-Origin', '*');
|
|
|
- res.header('Access-Control-Allow-Methods', 'GET,PUT,POST,DELETE');
|
|
|
- res.header('Access-Control-Allow-Headers', 'Content-Type');
|
|
|
- res.header('Access-Control-Allow-Credentials', 'true');
|
|
|
- next();
|
|
|
-};
|
|
|
-router.use(allowCrossDomain)
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
function goWrong(response,msg){
|
|
|
response.status(500)
|