<commit_before># Start
Sinatra inspired web framework.

[![](https://drone.io/lvivski/start/status.png)](https://drone.io/lvivski/start/latest)

It has simple API to serve static files from `public` folder (by default), rendered templates and websockets.

Start uses [Hart](https://github.com/lvivski/hart "lvivski/hart") as default template engine.

## Usage
Don't forget to compile views with `bin/compiler.dart` (views are precompiled in `example`).

```dart
import 'package:start/start.dart';
import 'views/views.dart';

void main() {
  start(view: new View(), public: 'example/public', port: 3000).then((app) {
    app.get('/', (req, res) {
      res.render('index', {'title': 'Start'});
    });

    app.get('/hello/:name.:lastname?', (req, res) {
      res.header('Content-Type', 'text/html; charset=UTF-8')
      .send('Hello, ${req.param('name')} ${req.param('lastname')}');
    });

    app.ws('/socket', (socket) {
      socket.on('ping', () { socket.send('pong'); })
      .on('ping', () { socket.close(1, 'requested'); });
    });
  });
}
```

## API<commit_msg>add note about optional views<commit_after># Start
Sinatra inspired web framework.

[![](https://drone.io/lvivski/start/status.png)](https://drone.io/lvivski/start/latest)

It has simple API to serve static files from `public` folder (by default), rendered templates and websockets.

Start uses [Hart](https://github.com/lvivski/hart "lvivski/hart") as default template engine.
The template engine is optional, you can use Start without Hart.

## Usage
Don't forget to compile views with `bin/compiler.dart` (views are precompiled in `example`).

```dart
import 'package:start/start.dart';
import 'views/views.dart';

void main() {
  start(view: new View(), public: 'example/public', port: 3000).then((app) {
    app.get('/', (req, res) {
      res.render('index', {'title': 'Start'});
    });

    app.get('/hello/:name.:lastname?', (req, res) {
      res.header('Content-Type', 'text/html; charset=UTF-8')
      .send('Hello, ${req.param('name')} ${req.param('lastname')}');
    });

    app.ws('/socket', (socket) {
      socket.on('ping', () { socket.send('pong'); })
      .on('ping', () { socket.close(1, 'requested'); });
    });
  });
}
```

## API
{'fraction_non_alphanumeric': 0.20797848498431196, 'fraction_numerical': 0.005378753922008068, 'mean_word_length': 3.9271523178807946, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '273041', 'n_tokens_mistral': 777, 'n_tokens_neox': 740, 'n_words': 178}