Skip to content

Commit

Permalink
fix: Small appyaml fixes (#57)
Browse files Browse the repository at this point in the history
  • Loading branch information
HalfdanJ authored Oct 14, 2022
2 parents 1f81546 + 83a792d commit d19cdfc
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
9 changes: 7 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ export default function entrypoint(options = {}) {
builder.rimraf(temporary);

builder.log.minor('Copying assets');
builder.writeClient(`${out}/storage`);
builder.writePrerendered(`${out}/storage`);
builder.writeClient(`${out}/storage${builder.config.kit.paths.base}`);
builder.writePrerendered(`${out}/storage${builder.config.kit.paths.base}`);

const relativePath = posix.relative(temporary, builder.getServerDirectory());

Expand Down Expand Up @@ -56,6 +56,7 @@ export default function entrypoint(options = {}) {
// eslint-disable-next-line camelcase
static_files: 'storage/' + page.file,
upload: 'storage/' + page.file,
secure: 'always',
}));

const prerenderedRedirects = Array.from(builder.prerendered.redirects, ([src, _]) => ({
Expand All @@ -80,11 +81,13 @@ export default function entrypoint(options = {}) {
// eslint-disable-next-line camelcase
static_dir: `storage/${builder.config.kit.appDir}/immutable`,
expiration: '30d 0h',
secure: 'always',
},
{
url: `/${builder.config.kit.appDir}/`,
// eslint-disable-next-line camelcase
static_dir: `storage/${builder.config.kit.appDir}`,
secure: 'always',
},
{
url: '/.*',
Expand All @@ -103,6 +106,8 @@ export default function entrypoint(options = {}) {
...yaml,
runtime: 'nodejs16',
entrypoint: 'node index.js',
// eslint-disable-next-line camelcase
default_expiration: '0h',
handlers: serverRoutes,
}),
);
Expand Down
6 changes: 6 additions & 0 deletions tests/expected_app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,25 @@ handlers:
- url: //?$
static_files: storage/index.html
upload: storage/index.html
secure: always
- url: /about/?$
static_files: storage/about.html
upload: storage/about.html
secure: always
- url: /sverdle/how-to-play/?$
static_files: storage/sverdle/how-to-play.html
upload: storage/sverdle/how-to-play.html
secure: always
- url: /_app/immutable/
static_dir: storage/_app/immutable
expiration: 30d 0h
secure: always
- url: /_app/
static_dir: storage/_app
secure: always
- url: /.*
secure: always
script: auto
runtime: nodejs16
entrypoint: node index.js
default_expiration: 0h

0 comments on commit d19cdfc

Please sign in to comment.