1.0.12 • Published 10 months ago
@certik/serverless-api v1.0.12
serverless API provider
A library that supports quick development and deployment for AWS lambda based serverless APIs
Made with ❤ by CertiK.
Prerequisite
Template Setup
Create a start-dev.js
file for dev
import pathModule from "node:path";
import { dirname, startLocalApp, getRoutes } from "@certik/serverless-api/dev.js";
import { handler } from "@certik/serverless-api/entrypoint.js";
async function main() {
const routes = await getRoutes(
pathModule.join(dirname(import.meta.url), "routes"),
);
return startLocalApp({ routes, handler });
}
main().catch((err) => {
console.error(err);
process.exit(1);
});
Create a deploy.js
file for pulumi deployment
import pathModule from "node:path";
import { dirname, createPulumiAPIApp, getRoutes } from "@certik/serverless-api/dev.js";
export default async function main() {
return createPulumiAPIApp({
routes: await getRoutes(
pathModule.join(dirname(import.meta.url), "routes"),
),
});
}
Create a routes
folder, and write handler functions there, an example handler function
export default async function handler(event) {
return {
statusCode: 200,
body: JSON.stringify(event),
};
}
Local Development Workflow
# use doppler
doppler login
doppler setup
# login pulumi
pulumi login
bun run lint
bun run test
bun run dev
Publish
bun run pub
1.0.12
10 months ago
1.0.11
12 months ago
1.0.10
1 year ago
1.0.2
1 year ago
1.0.1
1 year ago
1.0.0
1 year ago
1.0.9
1 year ago
1.0.8
1 year ago
1.0.7
1 year ago
1.0.6
1 year ago
1.0.5
1 year ago
1.0.4
1 year ago
1.0.3
1 year ago
0.3.7
2 years ago
0.3.6
2 years ago
0.3.5
2 years ago
0.3.4
2 years ago
0.3.3
2 years ago
0.3.2
2 years ago
0.3.1
2 years ago
0.3.0
2 years ago
0.2.0
2 years ago
0.1.1
2 years ago
0.1.0
2 years ago