https://github.com/dotxlem/asml-jamstack-test
https://github.com/dotxlem/asml-jamstack-test
Last synced: over 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/dotxlem/asml-jamstack-test
- Owner: dotxlem
- Created: 2021-08-10T19:55:52.000Z (almost 5 years ago)
- Default Branch: mainline
- Last Pushed: 2021-08-10T19:55:54.000Z (almost 5 years ago)
- Last Synced: 2025-02-09T05:26:55.672Z (over 1 year ago)
- Language: JavaScript
- Size: 72.3 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
AssemblyLift Jamstack Template
------------------------------
The repository provides a template for bootstrapping an AssemblyLift [Jamstack](https://jamstack.org) application.
[AssemblyLift](https://assemblylift.akkoro.io) **v0.3.1** or greater is required.
Install assemblylift with `cargo install assemblylift-cli`.
The `web` directory is a simple site built by webpack to demonstrate how a frontend can be integrated with an AssemblyLift project.
This could be replaced by full-featured framework such as React if desired.
### Building
- First run `npm install` to install webpack et al.
- The web frontend is built by running `npm run build`. The output of webpack is `./dist`, the contents of which will
be embedded in your deployed function.
- The AssemblyLift services can be built as usual with `asml cast` and deployed with `asml bind`.
- ⚠️ You will need an AWS account & credentials
See the [AssemblyLift documentation](https://docs.assemblylift.akkoro.io) for more details.
### How it works
The function `www/server` uses the `rust-embed` crate to embed the contents of the webpack `dist` directory in the compiled
WebAssembly binary. When invoked, the function proxies the path and attempts to match & return one of the embedded assets,
returning a 404 if an exact match is not found.