add delete to cors
This commit is contained in:
parent
fdf180971a
commit
434324159d
12
README.md
12
README.md
@ -1,3 +1,13 @@
|
||||
# MemberService
|
||||
|
||||
REST API used for the member portal for TTLMakerspace. Express, Mongodb.
|
||||
REST API used for the member portal for TTLMakerspace. Express, Mongodb.
|
||||
|
||||
Export the testing data from local via Compass.
|
||||
|
||||
Git pull at the server.
|
||||
|
||||
Import the test data:
|
||||
`mongoimport --db=makerspace --collection=members --file=makerspace.members.json --jsonArray --mode=delete`
|
||||
|
||||
Start the server:
|
||||
`nodemon --env-file=.env index.js`
|
2
index.js
2
index.js
@ -31,7 +31,7 @@ const allowedOrigins = ['https://members.ttlmakerspace.com', 'https://portal.ttl
|
||||
|
||||
app.use(cors({
|
||||
origin: 'https://portal.ttlmakerspace.com', // Allow only this origin
|
||||
methods: ['GET', 'POST', 'PATCH'], // Allow only GET and POST requests
|
||||
methods: ['GET', 'POST', 'PATCH', 'DELETE'], // Allow only GET and POST requests
|
||||
allowedHeaders: ['Content-Type', 'Authorization'] // Allow these headers
|
||||
}));
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user