Learn SERVERLESS-STACK with Real Code Examples
Updated Nov 27, 2025
Code Sample Descriptions
1
Simple SST App
# sst/demo/app.ts
import * as sst from '@serverless-stack/resources';
export default class MyStack extends sst.Stack {
constructor(scope, id, props) {
super(scope, id, props);
const api = new sst.Api(this, 'Api', {
routes: {
'GET /hello': new sst.Function(this, 'Lambda', {
handler: 'functions/hello.main'
})
}
});
this.addOutputs({
ApiEndpoint: api.url
});
}
}
A simple SST app creating an API and Lambda function.