Skip to content

Utilize the Google Cloud App Engine infrastructure to host SvelteKit content.

License

Notifications You must be signed in to change notification settings

HalfdanJ/svelte-adapter-appengine

Folders and files

NameName
Last commit message
Last commit date

Latest commit

1f4353f · Mar 26, 2022

History

58 Commits
Jan 20, 2022
Jan 7, 2022
Mar 26, 2022
Mar 26, 2022
Oct 20, 2021
Mar 26, 2022
Oct 20, 2021
Nov 9, 2021
Mar 26, 2022
Mar 26, 2022
Mar 26, 2022

Repository files navigation

svelte-adapter-appengine

Utilize the Google Cloud App Engine infrastructure to host SvelteKit content.

npm Tests

Setup

In your standard SvelteKit project:

  • npm install --save-dev svelte-adapter-appengine
  • add adapter to svelte.config.js:
+import appengine from "svelte-adapter-appengine";

/** @type {import('@sveltejs/kit').Config} */
export default {
  kit: {
+   adapter: appengine(),
    target: "#svelte",
  },
};
  • npm run build.
  • Application can then be deployed by running gcloud app deploy --project <CLOUD_PROJECT_ID> .appengine_build_output/app.yaml. (learn more about gcloud utility here)

Adapter Output

The SSR part of SvelteKit is hosted on App Engine in a nodejs runtime. It's running using polka mimicking @sveltejs/adapter-node .

Static files are served directly from Cloud Storage without going through the nodejs webserver. Routes for all the static assets are automatically generated in app.yaml by the adapter.

Example

An examplee app can be accessed on https://svelte-demo-329602.uc.r.appspot.com/, this is the default demo app from sveltekit deployed with the default settings.