
🚀 FaasJS
Features
Featherweight Development & Collaboration
- Break down complex projects into manageable components with the atomized development model.
- Enjoy fast iterations and seamless team collaboration.
- Jump start development with pre-built plugins for common functionalities like HTTP.
High maintainability
- The FaaS architecture ensures isolated cloud functions, preventing domino-effect errors.
- Automated testing tools built-in for robust and efficient testing.
High scalability
- Extend your application effortlessly with flexible and simple plugin mechanisms.
- Freely scale your functions up or down based on demand.
Quick start
Start with Codespaces and Templates
Start with Command Line
npx create-faas-app --name faasjs
npx create-faas-app --name faasjs-admin --template antd
basic is the default starter. Use --template antd when you want the Ant Design app shell.
Examples
Cloud function's file
// index.func.ts
// all cloud function file should be ended with .func.ts
import { defineApi } from '@faasjs/core'
export const func = defineApi({
async handler() {
return 'Hello, world' // response content
},
})
Unit test's file
// __tests__/index.test.ts
// unit test files should end with .test.ts
// jsdom UI tests should use .ui.test.ts or .ui.test.tsx
import { test } from '@faasjs/dev'
import Func from '../index.func'
describe('index', function () {
it('should work', async function () {
// wrap the cloud function
const func = test(Func)
// mock the request
const { statusCode, data } = await func.JSONhandler()
// expect the response with 200 status
expect(statusCode).toEqual(200)
// expect the response content is 'Hello, world'
expect(data).toEqual('Hello, world')
})
})
Thanks
Code contributors (in alphabetical order):
Germini,
hiisea,
iHeyTang,
luckyporo,
mingkang1993,
minzojian,
onichandame,
Vibutnum,
victoryifei,
WittCsharp,
zfben
Open source projects (in alphabetical order):