Welcome to the Finch Running Guide! This guide will walk you through the steps to run your Finch application. Whether you're a seasoned developer or just starting, Finch offers a robust set of tools to simplify server-side web app development.

app.dart

The main entry point for your Finch application is the app.dart file. This file contains the core logic and routing for your application. Below is a basic structure of what your app.dart file might look like:

import 'package:finch/finch.dart';

final configs = FinchConfigs(
  port: 8080,
  domain: 'example.com',
  dbConfig: FinchDBConfig(
    host: 'localhost',
    dbName: 'myapp',
    enable: true,
  ),
  enableLocalDebugger: true, // Only in development
);

void main() {
  var appServer = FinchApp(
    configs: configs
  );

  appServer.start();
  appServer.addRouting(getWebRoute);
}

Future<List<FinchRoute>> getWebRoute(Request rq) async {
  // Your routing logic here
  return [
    FinchRoute(
      path: '/',
      index: () async => rq.renderString(text: 'Hello World'),
    ),
  ];
}

Open this link to see your application in action: http://localhost:8080

Note:

Folowing the Finch example is the best way to understand how to use Finch. You can find the example in the example directory. we will add more examples with time. also you can check new ability of Finch in the demo page: https://example.uproid.com we keep it updated with the latest Finch version.