FuncPilot is a project brought to life by the recently published Version 4 of the Node Programming Model in Azure Functions (currently in public preview). Thanks to the improvements in the new programming model, this project aims to provide a solid structure for your Node function apps written in TypeScript while offering frequently used services and components with a first-class developer experience, inspired and known from great frameworks like Laravel, Adonis and similar.
⚠️ Warning: This project is currently in Alpha stage. Do not use it in production environments.
In order to locally develop and run your code using FuncPilot make sure you have Node.js v18 or above as well as the Azure Functions Core Tools v4.0.5095 or above installed and configured. Once you are ready:
- Use this repository as a template to create your own Function App
based on FuncPilot and clone the new repository to your local machine
$ git clone https://github.com/{YourName}/{YourProject}
- Create a
local.settings.json
file based on the provided example file (or bring your own)$ mv example.settings.json local.settings.json
- Define the routes aka functions within your Function App in the provided routes file under
src/routes/api.ts
export default function (route: Route) { route.get('/hello', [new HelloController, 'index']) }
- Create corresponding controllers under
src/app/Http/Controllers
to handle invocations of your functionsexport class HelloController extends BaseController { public async index(request: HttpRequest): Promise<HttpResponseInit> { const name = request.query.get('name') return { status: 200, jsonBody: { message: name ? `Hello, ${name}!` : 'Hello World!' } } } }
- Build and run the Function App locally to test if everything works
$ npm run start