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:
@@ -126,6 +126,7 @@ export default defineEventHandler(async (event) => {
|
||||
|
||||
// CORS-Header für Cross-Device Authentication
|
||||
// WICHTIG: Für Cross-Device muss CORS korrekt konfiguriert sein
|
||||
// OPTIONS-Requests werden von .options.js behandelt
|
||||
const allowedOrigin = requestOrigin || webauthnOrigin
|
||||
|
||||
if (allowedOrigin) {
|
||||
@@ -134,21 +135,13 @@ export default defineEventHandler(async (event) => {
|
||||
setHeader(event, 'Access-Control-Allow-Methods', 'GET, POST, OPTIONS')
|
||||
setHeader(event, 'Access-Control-Allow-Headers', 'Content-Type, Authorization, Origin, X-Requested-With')
|
||||
setHeader(event, 'Access-Control-Max-Age', '86400') // 24 Stunden Cache für Preflight
|
||||
console.log('[DEBUG] CORS headers set', {
|
||||
console.log('[DEBUG] CORS headers set for POST', {
|
||||
origin: allowedOrigin,
|
||||
requestOrigin,
|
||||
webauthnOrigin,
|
||||
method: getMethod(event)
|
||||
webauthnOrigin
|
||||
})
|
||||
}
|
||||
|
||||
// OPTIONS Preflight-Request für Cross-Device
|
||||
if (getMethod(event) === 'OPTIONS') {
|
||||
console.log('[DEBUG] OPTIONS preflight request, returning 204')
|
||||
setResponseStatus(event, 204)
|
||||
return null
|
||||
}
|
||||
|
||||
// Stelle sicher, dass die Options korrekt serialisiert werden
|
||||
const serializedOptions = {
|
||||
...options,
|
||||
|
||||
Reference in New Issue
Block a user