Mercurial
comparison benchmark/bun-http-framework-benchmark/dev/adonis/config/static.ts @ 183:a8976a008a9d
[BenchMark] Added bun bench mark to test seoboe vs other popular benchmarks.
| author | MrJuneJune <me@mrjunejune.com> |
|---|---|
| date | Fri, 23 Jan 2026 21:19:08 -0800 |
| parents | |
| children |
comparison
equal
deleted
inserted
replaced
| 179:8d17f6e6e290 | 183:a8976a008a9d |
|---|---|
| 1 /** | |
| 2 * Config source: https://git.io/Jfefl | |
| 3 * | |
| 4 * Feel free to let us know via PR, if you find something broken in this config | |
| 5 * file. | |
| 6 */ | |
| 7 | |
| 8 import { AssetsConfig } from '@ioc:Adonis/Core/Static' | |
| 9 | |
| 10 const staticConfig: AssetsConfig = { | |
| 11 /* | |
| 12 |-------------------------------------------------------------------------- | |
| 13 | Enabled | |
| 14 |-------------------------------------------------------------------------- | |
| 15 | | |
| 16 | A boolean to enable or disable serving static files. The static files | |
| 17 | are served from the `public` directory inside the application root. | |
| 18 | However, you can override the default path inside `.adonisrc.json` | |
| 19 | file. | |
| 20 | | |
| 21 | | |
| 22 */ | |
| 23 enabled: true, | |
| 24 | |
| 25 /* | |
| 26 |-------------------------------------------------------------------------- | |
| 27 | Handling Dot Files | |
| 28 |-------------------------------------------------------------------------- | |
| 29 | | |
| 30 | Decide how you want the static assets server to handle the `dotfiles`. | |
| 31 | By default, we ignore them as if they don't exists. However, you | |
| 32 | can choose between one of the following options. | |
| 33 | | |
| 34 | - ignore: Behave as if the file doesn't exists. Results in 404. | |
| 35 | - deny: Deny access to the file. Results in 403. | |
| 36 | - allow: Serve the file contents | |
| 37 | | |
| 38 */ | |
| 39 dotFiles: 'ignore', | |
| 40 | |
| 41 /* | |
| 42 |-------------------------------------------------------------------------- | |
| 43 | Generating Etag | |
| 44 |-------------------------------------------------------------------------- | |
| 45 | | |
| 46 | Handle whether or not to generate etags for the files. Etag allows browser | |
| 47 | to utilize the cache when file hasn't been changed. | |
| 48 | | |
| 49 */ | |
| 50 etag: true, | |
| 51 | |
| 52 /* | |
| 53 |-------------------------------------------------------------------------- | |
| 54 | Set Last Modified | |
| 55 |-------------------------------------------------------------------------- | |
| 56 | | |
| 57 | Whether or not to set the `Last-Modified` header in the response. Uses | |
| 58 | the file system's last modified value. | |
| 59 | | |
| 60 */ | |
| 61 lastModified: true, | |
| 62 | |
| 63 /* | |
| 64 |-------------------------------------------------------------------------- | |
| 65 | Max age | |
| 66 |-------------------------------------------------------------------------- | |
| 67 | | |
| 68 | Set the value for the max-age directive. Set a higher value in production | |
| 69 | if you fingerprint your assets. | |
| 70 | | |
| 71 | Learn more: https://docs.adonisjs.com/guides/deployment#serving-static-assets | |
| 72 | | |
| 73 */ | |
| 74 maxAge: 0, | |
| 75 | |
| 76 /* | |
| 77 |-------------------------------------------------------------------------- | |
| 78 | Immutable | |
| 79 |-------------------------------------------------------------------------- | |
| 80 | | |
| 81 | Set the immutable directive. Set it to `true` if the assets are generated | |
| 82 | with a fingerprint. In others words the file name changes when the file | |
| 83 | contents change. | |
| 84 | | |
| 85 */ | |
| 86 immutable: false, | |
| 87 } | |
| 88 | |
| 89 export default staticConfig |