Enhance deployment script with PM2 process checks and error handling
Some checks failed
Code Analysis (JS/Vue) / analyze (push) Failing after 49s
Some checks failed
Code Analysis (JS/Vue) / analyze (push) Failing after 49s
Update deploy-production.sh to include checks for PM2 installation and process existence before restarting. Implement error messages for failed starts and restarts, improving robustness and user guidance during deployment. Additionally, add useful commands for managing the PM2 process post-deployment.
This commit is contained in:
@@ -20,19 +20,18 @@ export default defineEventHandler(async (event) => {
|
||||
})
|
||||
|
||||
// CORS-Header für Cross-Device Authentication
|
||||
// OPTIONS-Requests werden von .options.js behandelt
|
||||
const allowedOrigin = requestOrigin || webauthnOrigin
|
||||
if (allowedOrigin) {
|
||||
setHeader(event, 'Access-Control-Allow-Origin', allowedOrigin)
|
||||
setHeader(event, 'Access-Control-Allow-Credentials', 'true')
|
||||
setHeader(event, 'Access-Control-Allow-Methods', 'POST, OPTIONS')
|
||||
setHeader(event, 'Access-Control-Allow-Headers', 'Content-Type, Authorization, Origin, X-Requested-With')
|
||||
}
|
||||
|
||||
// OPTIONS Preflight-Request
|
||||
if (getMethod(event) === 'OPTIONS') {
|
||||
console.log('[DEBUG] OPTIONS preflight request, returning 204')
|
||||
setResponseStatus(event, 204)
|
||||
return null
|
||||
console.log('[DEBUG] CORS headers set for POST', {
|
||||
origin: allowedOrigin,
|
||||
requestOrigin,
|
||||
webauthnOrigin
|
||||
})
|
||||
}
|
||||
|
||||
const body = await readBody(event)
|
||||
|
||||
Reference in New Issue
Block a user