1.0.12 • Published 8 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
8 months ago
1.0.11
9 months ago
1.0.10
9 months ago
1.0.2
11 months ago
1.0.1
11 months ago
1.0.0
11 months ago
1.0.9
11 months ago
1.0.8
11 months ago
1.0.7
11 months ago
1.0.6
11 months ago
1.0.5
11 months ago
1.0.4
11 months ago
1.0.3
11 months 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