Update CORS
Signed-off-by: Fred Boniface <fred@fjla.uk>
This commit is contained in:
parent
08de9bcbc1
commit
681cf873dd
7
app.js
7
app.js
@ -14,8 +14,8 @@ const app = express();
|
||||
// Middleware
|
||||
const compression = require('compression');
|
||||
const rateLimit = require('express-rate-limit');
|
||||
const authenticate= require('./src/middlewares/auth.middlewares');
|
||||
const cors = require('cors');
|
||||
const authenticate= require('./src/middlewares/auth.middlewares');
|
||||
|
||||
// Internal Requires
|
||||
const log = require('./src/utils/log.utils');
|
||||
@ -62,7 +62,10 @@ app.use((err, req, res, next) => {
|
||||
});
|
||||
|
||||
// Global Middleware:
|
||||
app.use(cors()); // Allow access from any origin
|
||||
app.use(cors({
|
||||
origin: [/\.owlboard\.info$/, 'localhost'],
|
||||
methods:'GET,POST,OPTIONS'
|
||||
}));
|
||||
app.use(express.json()); //JSON Parsing for POST Requests
|
||||
app.use(compression()); // Compress API Data if supported by client
|
||||
app.use(limiter);
|
||||
|
Loading…
Reference in New Issue
Block a user