first commit

This commit is contained in:
Rutra committed 2026-10-12 14:25:22 +02:00
commit 3c0479faf0
169 files changed
+27617

No files matched your search

+25
View File
@@ -0,0 +1,25 @@
import { existsSync } from 'node:fs'
import app from '@adonisjs/core/services/app'
import type { HttpContext } from '@adonisjs/core/http'
/**
* Serves the Angular application for every URL that is neither a file
* of "public/" nor an API route (/containers, /projects/…).
*/
export default class SpaController {
async index({ request, response }: HttpContext) {
if (request.url().startsWith('/api/')) {
return response.notFound({ message: 'Route inconnue.' })
}
const index = app.publicPath('index.html')
if (!existsSync(index)) {
return response.notFound(
'Interface non compilée : lance "npm run build" dans web/ (ou "npm start" pour le développement).'
)
}
response.header('Cache-Control', 'no-cache')
return response.download(index)
}
}