Skip to content

Commit 7a7f15c

Browse files
author
Ryan Miville
committed
using sst for example
1 parent 12640ae commit 7a7f15c

File tree

7 files changed

+93
-23
lines changed

7 files changed

+93
-23
lines changed

examples/simple/.gitignore

+5
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1+
.DS_Store
2+
node_modules
13
*.beam
24
*.ez
35
/build
46
erl_crash.dump
7+
8+
# sst
9+
.sst

examples/simple/README.md

+2-23
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,3 @@
1-
# app
1+
# Simple Example
22

3-
[![Package Version](https://img.shields.io/hexpm/v/app)](https://hex.pm/packages/app)
4-
[![Hex Docs](https://img.shields.io/badge/hex-docs-ffaff3)](https://hexdocs.pm/app/)
5-
6-
```sh
7-
gleam add app@1
8-
```
9-
```gleam
10-
import app
11-
12-
pub fn main() {
13-
// TODO: An example of the project in use
14-
}
15-
```
16-
17-
Further documentation can be found at <https://hexdocs.pm/app>.
18-
19-
## Development
20-
21-
```sh
22-
gleam run # Run the project
23-
gleam test # Run the tests
24-
```
3+
This is a simple lambda function that is build and deployed using SST.

examples/simple/bun.lockb

8.39 KB
Binary file not shown.

examples/simple/package.json

+18
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
{
2+
"name": "simple",
3+
"version": "1.0.0",
4+
"type": "module",
5+
"scripts": {
6+
"dev": "gleam build && sst dev"
7+
},
8+
"devDependencies": {
9+
"@types/aws-lambda": "8.10.145",
10+
"@types/bun": "latest"
11+
},
12+
"peerDependencies": {
13+
"typescript": "^5.0.0"
14+
},
15+
"dependencies": {
16+
"sst": "3.2.48"
17+
}
18+
}

examples/simple/sst-env.d.ts

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
/* This file is auto-generated by SST. Do not edit. */
2+
/* tslint:disable */
3+
/* eslint-disable */
4+
/* deno-fmt-ignore-file */
5+
import "sst"
6+
export {}
7+
declare module "sst" {
8+
export interface Resource {
9+
"SimpleExample": {
10+
"name": string
11+
"type": "sst.aws.Function"
12+
"url": string
13+
}
14+
}
15+
}

examples/simple/sst.config.ts

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/// <reference path="./.sst/platform/config.d.ts" />
2+
3+
export default $config({
4+
app(input) {
5+
return {
6+
name: "simple-example",
7+
removal: input?.stage === "production" ? "retain" : "remove",
8+
home: "aws",
9+
providers: {
10+
aws: {
11+
region: "us-east-1",
12+
profile: "personal",
13+
},
14+
},
15+
};
16+
},
17+
async run() {
18+
const api = new sst.aws.Function("SimpleExample", {
19+
handler: "build/dev/javascript/handler/handler.handler",
20+
url: true,
21+
});
22+
return {
23+
url: api.url,
24+
};
25+
},
26+
});

examples/simple/tsconfig.json

+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
{
2+
"compilerOptions": {
3+
// Enable latest features
4+
"lib": ["ESNext", "DOM"],
5+
"target": "ESNext",
6+
"module": "ESNext",
7+
"moduleDetection": "force",
8+
"jsx": "react-jsx",
9+
"allowJs": true,
10+
11+
// Bundler mode
12+
"moduleResolution": "bundler",
13+
"allowImportingTsExtensions": true,
14+
"verbatimModuleSyntax": true,
15+
"noEmit": true,
16+
17+
// Best practices
18+
"strict": true,
19+
"skipLibCheck": true,
20+
"noFallthroughCasesInSwitch": true,
21+
22+
// Some stricter flags (disabled by default)
23+
"noUnusedLocals": false,
24+
"noUnusedParameters": false,
25+
"noPropertyAccessFromIndexSignature": false
26+
}
27+
}

0 commit comments

Comments
 (0)