room reservation model, controller, seeder and migration files added
This commit is contained in:
@@ -1,17 +1,5 @@
|
||||
import env from '#start/env'
|
||||
import app from '@adonisjs/core/services/app'
|
||||
import { Secret } from '@adonisjs/core/helpers'
|
||||
import { defineConfig } from '@adonisjs/core/http'
|
||||
|
||||
/**
|
||||
* The app key is used for encrypting cookies, generating signed URLs,
|
||||
* and by the "encryption" module.
|
||||
*
|
||||
* The encryption module will fail to decrypt data if the key is lost or
|
||||
* changed. Therefore it is recommended to keep the app key secure.
|
||||
*/
|
||||
export const appKey = new Secret(env.get('APP_KEY'))
|
||||
|
||||
/**
|
||||
* The configuration settings used by the HTTP server
|
||||
*/
|
||||
|
||||
+14
-3
@@ -7,11 +7,22 @@ import { defineConfig } from '@adonisjs/cors'
|
||||
* https://docs.adonisjs.com/guides/security/cors
|
||||
*/
|
||||
const corsConfig = defineConfig({
|
||||
enabled: true,
|
||||
origin: true,
|
||||
origin: (requestOrigin) => {
|
||||
/**
|
||||
* Allow localhost on any port during development.
|
||||
*/
|
||||
if (
|
||||
requestOrigin.includes('localhost') ||
|
||||
requestOrigin.includes('0.0.0.0') ||
|
||||
requestOrigin.includes('127.0.0.1') ||
|
||||
requestOrigin.includes('::1')) {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
},
|
||||
|
||||
methods: ['GET', 'HEAD', 'POST', 'PUT', 'DELETE'],
|
||||
headers: true,
|
||||
exposeHeaders: [],
|
||||
credentials: true,
|
||||
maxAge: 90,
|
||||
})
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
import env from '#start/env'
|
||||
import app from '@adonisjs/core/services/app'
|
||||
import { defineConfig, services } from '@adonisjs/drive'
|
||||
|
||||
const driveConfig = defineConfig({
|
||||
default: env.get('DRIVE_DISK'),
|
||||
|
||||
/**
|
||||
* The services object can be used to configure multiple file system
|
||||
* services each using the same or a different driver.
|
||||
*/
|
||||
services: {
|
||||
fs: services.fs({
|
||||
location: app.makePath('storage/uploads'),
|
||||
serveFiles: false,
|
||||
visibility: 'public',
|
||||
}),
|
||||
},
|
||||
})
|
||||
|
||||
export default driveConfig
|
||||
|
||||
declare module '@adonisjs/drive/types' {
|
||||
export interface DriveDisks extends InferDriveDisks<typeof driveConfig> {}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
import env from '#start/env'
|
||||
import { defineConfig, drivers } from '@adonisjs/core/encryption'
|
||||
|
||||
export default defineConfig({
|
||||
default: 'legacy',
|
||||
list: {
|
||||
legacy: drivers.legacy({
|
||||
keys: [env.get('APP_KEY')],
|
||||
}),
|
||||
},
|
||||
})
|
||||
Reference in New Issue
Block a user