nullstack-serverless
v0.0.2
Published
Nullstack construct for CDK
Downloads
5
Maintainers
Readme
Infrastructure folder
Here, it lays the CDK App. Where the magic happens.
There is a a testing/index.ts
file, there is a CDK app being instantiated and creating 3 nullstack apps.
What the construct, that is located at lib/nullstack-construct.ts
, does is:
- It creates an s3 bucket to host all the public files.
- (SSR only) It creates a private s3 bucket to host the build files. in it, there will be a folder, with an index.js, where it uses @codegenie/serverless-express, and gets the Express server in Nullstack and converts it into a lambda function; in this folder there is also the node_modules of this external package, and a .production folder from nullstack (changed server.js in it removing the crossorigin attribute - explained here, but got merged on Nullstack v0.19.2).
- It deploys the necessary files into these buckets.
- (SSR only) It creates a lambda that will run the files in the build bucket
- (SSR only) It creates an API Gateway with the route
/
and the route/{proxy+}
for the rest of the routes. - (SSR only) It creates a lambda function url for it to be accessible.
- (SSG and SPA only) It creates an s3 website url for it to be accessible.