add delete to cors

This commit is contained in:
OddlyTimbot 2025-02-21 12:19:36 -05:00
parent fdf180971a
commit 434324159d
2 changed files with 12 additions and 2 deletions

View File

@ -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`

View File

@ -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
}));