Update README + deps

This commit is contained in:
Tobe O 2018-11-08 11:19:31 -05:00
parent baad6bc628
commit 43e953044b
3 changed files with 11 additions and 2 deletions

View file

@ -8,6 +8,13 @@ the infamous
[flash of unstyled content](https://en.wikipedia.org/wiki/Flash_of_unstyled_content),
and other SEO optimizations that can easily become tedious to perform by hand.
## Disabling inlining per-element
Add a `data-no-inline` attribute to a `link` or `script` to prevent inlining it:
```html
<script src="main.dart.js" data-no-inline></script>
```
## `inlineAssets`
A
[response finalizer](https://angel-dart.gitbook.io/angel/the-basics/request-lifecycle)

View file

@ -1,9 +1,10 @@
import 'dart:convert';
import 'package:angel_framework/angel_framework.dart';
import 'package:angel_framework/http.dart';
import 'package:angel_seo/angel_seo.dart';
import 'package:angel_static/angel_static.dart';
import 'package:dart2_constant/convert.dart';
import 'package:file/local.dart';
import 'package:http_parser/http_parser.dart';
main() async {
var app = new Angel();
@ -31,7 +32,7 @@ main() async {
var indexHtml = fs.directory('web').childFile('index.html');
var contents = await indexHtml.readAsString();
res
..headers['content-type'] = 'text/html; charset=utf-8'
..contentType = new MediaType('text', 'html', {'charset': 'utf-8'})
..buffer.add(utf8.encode(contents));
});

View file

@ -10,6 +10,7 @@ dependencies:
angel_static: ^2.0.0-alpha
file: ^5.0.0
html: ^0.13.0
http_parser: ^3.0.0
path: ^1.0.0
dev_dependencies:
angel_test: ^2.0.0-alpha