@timmons-group/local-sam-dev
v0.2.0-alpha.5
Published
Tools for running SAM apps locally for development
Maintainers
Keywords
Readme
Local SAM Development
This is a local developmemnt server for SAM applications that is able to emulate API Gateway, Lambda, DynamoDB, and S3. It is a great way to test your serverless applications locally before deploying them to AWS.
Sample
import localDevBuilder from '@timmons-group/local-sam-dev/builder.js';
import { createServer as vite } from 'vite';
// These are the parameters normally used in the template
// These are not environment variables, but are passed in as parameters
const parameters = {
"Website": "Test",
};
const overrides = {
"CustomDomainName": "localhost:4000",
};
const frontend_server = await vite({
root: `../frontend/`,
configFile: `../frontend/vite.config.js`,
});
frontend_server.httpServer.listen(4002);
const server = await localDevBuilder
.withTemplate(`sam/template.yaml`)
.withAppName(`Test`)
.withParameters(parameters)
.withOverrides(overrides)
.withPort(4000)
.withSSL({
store: true,
})
.withFrontend({
forward: 4002
})
.build();
console.log(server.schema);This will create a server on port 4000 and a vite server on 4002.
