Added vercel cors

pull/816/head
Shubham Verma 2020-09-23 18:35:37 +05:30
parent bac2b32ca7
commit 90999fa5e8
2 changed files with 12937 additions and 4 deletions

View File

@ -1,10 +1,6 @@
require('dotenv').config(); require('dotenv').config();
const pkg = require('./package.json');
module.exports = { module.exports = {
env: {
VERSION: pkg.version,
},
webpack(config) { webpack(config) {
config.module.rules.push({ config.module.rules.push({
test: /\.svg$/, test: /\.svg$/,
@ -16,4 +12,22 @@ module.exports = {
return config; return config;
}, },
async headers() {
return [
{
// mathching all API routes
source: '/api/:path*',
headers: [
{ key: 'Access-Control-Allow-Credentials', value: 'true' },
{ key: 'Access-Control-Allow-Origin', value: '*' },
{ key: 'Access-Control-Allow-Methods', value: 'GET,OPTIONS,PATCH,DELETE,POST,PUT' },
{
key: 'Access-Control-Allow-Headers',
value:
'X-CSRF-Token, X-Requested-With, Accept, Accept-Version, Content-Length, Content-MD5, Content-Type, Date, X-Api-Version',
},
],
},
];
},
}; };

12919
package-lock.json generated Normal file

File diff suppressed because it is too large Load Diff