Add flags to Angel constructor

This commit is contained in:
Tobe O 2018-08-20 21:05:05 -04:00
parent ecb15293a9
commit 340b08da1b
8 changed files with 251 additions and 233 deletions

View file

@ -2,7 +2,14 @@
<project version="4"> <project version="4">
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="7b89ff1e-1260-4dcf-9c3d-345de0471ea1" name="Default" comment=""> <list default="true" id="7b89ff1e-1260-4dcf-9c3d-345de0471ea1" name="Default" comment="">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/CHANGELOG.md" beforeDir="false" afterPath="$PROJECT_DIR$/CHANGELOG.md" afterDir="false" />
<change beforePath="$PROJECT_DIR$/example/handle_error.dart" beforeDir="false" afterPath="$PROJECT_DIR$/example/handle_error.dart" afterDir="false" />
<change beforePath="$PROJECT_DIR$/example/main.dart" beforeDir="false" afterPath="$PROJECT_DIR$/example/main.dart" afterDir="false" />
<change beforePath="$PROJECT_DIR$/lib/src/core/server.dart" beforeDir="false" afterPath="$PROJECT_DIR$/lib/src/core/server.dart" afterDir="false" /> <change beforePath="$PROJECT_DIR$/lib/src/core/server.dart" beforeDir="false" afterPath="$PROJECT_DIR$/lib/src/core/server.dart" afterDir="false" />
<change beforePath="$PROJECT_DIR$/lib/src/http/controller.dart" beforeDir="false" afterPath="$PROJECT_DIR$/lib/src/http/controller.dart" afterDir="false" />
<change beforePath="$PROJECT_DIR$/test/routing_test.dart" beforeDir="false" afterPath="$PROJECT_DIR$/test/routing_test.dart" afterDir="false" />
<change beforePath="$PROJECT_DIR$/test/server_test.dart" beforeDir="false" afterPath="$PROJECT_DIR$/test/server_test.dart" afterDir="false" />
</list> </list>
<ignored path="$PROJECT_DIR$/.tmp/" /> <ignored path="$PROJECT_DIR$/.tmp/" />
<ignored path="$PROJECT_DIR$/temp/" /> <ignored path="$PROJECT_DIR$/temp/" />
@ -25,13 +32,13 @@
</component> </component>
<component name="FileEditorManager"> <component name="FileEditorManager">
<leaf SIDE_TABS_SIZE_LIMIT_KEY="300"> <leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
<file leaf-file-name="server.dart" pinned="false" current-in-tab="true"> <file leaf-file-name="main.dart" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/lib/src/core/server.dart"> <entry file="file://$PROJECT_DIR$/example/main.dart">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="275"> <state relative-caret-position="54">
<caret line="363" column="45" selection-start-line="363" selection-start-column="45" selection-end-line="363" selection-end-column="45" /> <caret line="4" column="19" selection-start-line="4" selection-start-column="19" selection-end-line="4" selection-end-column="19" />
<folding> <folding>
<element signature="e#38#58#0" expanded="true" /> <element signature="e#0#46#0" expanded="true" />
</folding> </folding>
</state> </state>
</provider> </provider>
@ -40,8 +47,8 @@
<file leaf-file-name="angel_http.dart" pinned="false" current-in-tab="false"> <file leaf-file-name="angel_http.dart" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/lib/src/http/angel_http.dart"> <entry file="file://$PROJECT_DIR$/lib/src/http/angel_http.dart">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="166"> <state relative-caret-position="-140">
<caret line="64" column="7" selection-start-line="64" selection-start-column="7" selection-end-line="64" selection-end-column="7" /> <caret line="163" column="31" lean-forward="true" selection-start-line="163" selection-start-column="31" selection-end-line="163" selection-end-column="31" />
<folding> <folding>
<element signature="e#0#20#0" expanded="true" /> <element signature="e#0#20#0" expanded="true" />
</folding> </folding>
@ -49,80 +56,80 @@
</provider> </provider>
</entry> </entry>
</file> </file>
<file leaf-file-name="response_context.dart" pinned="false" current-in-tab="false"> <file leaf-file-name="routing_test.dart" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/lib/src/core/response_context.dart"> <entry file="file://$PROJECT_DIR$/test/routing_test.dart">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="165"> <state relative-caret-position="149">
<caret line="317" column="62" selection-start-line="317" selection-start-column="62" selection-end-line="317" selection-end-column="62" /> <caret line="103" column="31" selection-start-line="103" selection-start-column="31" selection-end-line="103" selection-end-column="31" />
<folding>
<element signature="e#48#68#0" expanded="true" />
</folding>
</state> </state>
</provider> </provider>
</entry> </entry>
</file> </file>
<file leaf-file-name="controller.dart" pinned="false" current-in-tab="false"> <file leaf-file-name="CHANGELOG.md" pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/lib/src/http/controller.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-1153">
<caret line="16" lean-forward="true" selection-start-line="16" selection-end-line="16" />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="CHANGELOG.md" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/CHANGELOG.md"> <entry file="file://$PROJECT_DIR$/CHANGELOG.md">
<provider selected="true" editor-type-id="split-provider[text-editor;markdown-preview-editor]"> <provider selected="true" editor-type-id="split-provider[text-editor;markdown-preview-editor]">
<state split_layout="SPLIT"> <state split_layout="SPLIT">
<first_editor relative-caret-position="329"> <first_editor relative-caret-position="540">
<caret line="47" column="21" selection-start-line="47" selection-start-column="21" selection-end-line="47" selection-end-column="21" /> <caret line="53" column="75" selection-start-line="53" selection-start-column="75" selection-end-line="53" selection-end-column="75" />
</first_editor> </first_editor>
<second_editor /> <second_editor />
</state> </state>
</provider> </provider>
</entry> </entry>
</file> </file>
<file leaf-file-name="injection.dart" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/lib/src/core/injection.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="293">
<caret line="44" column="38" selection-start-line="44" selection-start-column="38" selection-end-line="44" selection-end-column="38" />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="primitives_test.dart" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/test/primitives_test.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="128">
<caret line="14" column="37" selection-start-line="14" selection-start-column="37" selection-end-line="14" selection-end-column="37" />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="precontained_test.dart" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/test/precontained_test.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="64">
<caret line="9" column="54" lean-forward="true" selection-start-line="9" selection-start-column="54" selection-end-line="9" selection-end-column="54" />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="service.dart" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/lib/src/core/service.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="125">
<caret line="9" column="23" selection-start-line="9" selection-start-column="23" selection-end-line="9" selection-end-column="23" />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="server_test.dart" pinned="false" current-in-tab="false"> <file leaf-file-name="server_test.dart" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/test/server_test.dart"> <entry file="file://$PROJECT_DIR$/test/server_test.dart">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="204"> <state relative-caret-position="160">
<caret line="92" column="31" selection-start-line="92" selection-start-column="31" selection-end-line="92" selection-end-column="31" /> <caret line="18" column="17" selection-start-line="18" selection-start-column="17" selection-end-line="18" selection-end-column="17" />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="server.dart" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/lib/src/core/server.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="406">
<caret line="370" column="38" selection-start-line="370" selection-start-column="38" selection-end-line="370" selection-end-column="38" />
<folding>
<element signature="e#38#58#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<file leaf-file-name="future_impl.dart" pinned="false" current-in-tab="false">
<entry file="file:///usr/local/opt/dart/libexec/lib/async/future_impl.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="129">
<caret line="128" column="17" selection-start-line="128" selection-start-column="17" selection-end-line="128" selection-end-column="17" />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="zone.dart" pinned="false" current-in-tab="false">
<entry file="file:///usr/local/opt/dart/libexec/lib/async/zone.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="129">
<caret line="1378" column="53" selection-start-line="1378" selection-start-column="53" selection-end-line="1378" selection-end-column="53" />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="controller.dart" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/lib/src/http/controller.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-369">
<caret line="45" column="34" lean-forward="true" selection-start-line="45" selection-start-column="34" selection-end-line="45" selection-end-column="34" />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="handle_error.dart" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/example/handle_error.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="112">
<caret line="11" column="15" selection-start-line="11" selection-start-column="15" selection-end-line="11" selection-end-column="15" />
</state> </state>
</provider> </provider>
</entry> </entry>
@ -139,7 +146,6 @@
</component> </component>
<component name="FindInProjectRecents"> <component name="FindInProjectRecents">
<findStrings> <findStrings>
<find>god.deserialize</find>
<find>reflector</find> <find>reflector</find>
<find>Angel(M</find> <find>Angel(M</find>
<find>pool</find> <find>pool</find>
@ -169,6 +175,7 @@
<find>injections</find> <find>injections</find>
<find>injecti</find> <find>injecti</find>
<find>debug</find> <find>debug</find>
<find>handle(</find>
</findStrings> </findStrings>
<replaceStrings> <replaceStrings>
<replace>'server'</replace> <replace>'server'</replace>
@ -245,20 +252,14 @@
<option value="$PROJECT_DIR$/lib/src/core/angel_base.dart" /> <option value="$PROJECT_DIR$/lib/src/core/angel_base.dart" />
<option value="$PROJECT_DIR$/lib/src/core/core.dart" /> <option value="$PROJECT_DIR$/lib/src/core/core.dart" />
<option value="$PROJECT_DIR$/lib/src/http/http_response_context.dart" /> <option value="$PROJECT_DIR$/lib/src/http/http_response_context.dart" />
<option value="$PROJECT_DIR$/example/handle_error.dart" />
<option value="$PROJECT_DIR$/pubspec.yaml" /> <option value="$PROJECT_DIR$/pubspec.yaml" />
<option value="$PROJECT_DIR$/lib/src/http/http_request_context.dart" />
<option value="$PROJECT_DIR$/lib/src/core/routable.dart" />
<option value="$PROJECT_DIR$/test/general_test.dart" /> <option value="$PROJECT_DIR$/test/general_test.dart" />
<option value="$PROJECT_DIR$/example/json.dart" /> <option value="$PROJECT_DIR$/example/json.dart" />
<option value="$PROJECT_DIR$/lib/src/core/metadata.dart" /> <option value="$PROJECT_DIR$/lib/src/core/metadata.dart" />
<option value="$PROJECT_DIR$/example/view.dart" /> <option value="$PROJECT_DIR$/example/view.dart" />
<option value="$PROJECT_DIR$/lib/src/core/hooked_service.dart" />
<option value="$PROJECT_DIR$/test/streaming_test.dart" /> <option value="$PROJECT_DIR$/test/streaming_test.dart" />
<option value="$PROJECT_DIR$/example/main.dart" />
<option value="$PROJECT_DIR$/test/serialize_test.dart" /> <option value="$PROJECT_DIR$/test/serialize_test.dart" />
<option value="$PROJECT_DIR$/test/parameter_meta_test.dart" /> <option value="$PROJECT_DIR$/test/parameter_meta_test.dart" />
<option value="$PROJECT_DIR$/test/routing_test.dart" />
<option value="$PROJECT_DIR$/test/di_test.dart" /> <option value="$PROJECT_DIR$/test/di_test.dart" />
<option value="$PROJECT_DIR$/test/encoders_buffer_test.dart" /> <option value="$PROJECT_DIR$/test/encoders_buffer_test.dart" />
<option value="$PROJECT_DIR$/test/repeat_request_test.dart" /> <option value="$PROJECT_DIR$/test/repeat_request_test.dart" />
@ -266,15 +267,21 @@
<option value="$PROJECT_DIR$/performance/hello/main.dart" /> <option value="$PROJECT_DIR$/performance/hello/main.dart" />
<option value="$PROJECT_DIR$/test/precontained_test.dart" /> <option value="$PROJECT_DIR$/test/precontained_test.dart" />
<option value="$PROJECT_DIR$/lib/src/core/response_context.dart" /> <option value="$PROJECT_DIR$/lib/src/core/response_context.dart" />
<option value="$PROJECT_DIR$/test/server_test.dart" />
<option value="$PROJECT_DIR$/test/primitives_test.dart" /> <option value="$PROJECT_DIR$/test/primitives_test.dart" />
<option value="$PROJECT_DIR$/lib/src/core/service.dart" /> <option value="$PROJECT_DIR$/lib/src/core/service.dart" />
<option value="$PROJECT_DIR$/lib/src/core/injection.dart" /> <option value="$PROJECT_DIR$/lib/src/core/injection.dart" />
<option value="$PROJECT_DIR$/lib/src/core/request_context.dart" /> <option value="$PROJECT_DIR$/lib/src/core/request_context.dart" />
<option value="$PROJECT_DIR$/CHANGELOG.md" /> <option value="$PROJECT_DIR$/lib/src/core/hooked_service.dart" />
<option value="$PROJECT_DIR$/lib/src/http/angel_http.dart" /> <option value="$PROJECT_DIR$/lib/src/http/http_request_context.dart" />
<option value="$PROJECT_DIR$/lib/src/core/routable.dart" />
<option value="$PROJECT_DIR$/lib/src/http/controller.dart" /> <option value="$PROJECT_DIR$/lib/src/http/controller.dart" />
<option value="$PROJECT_DIR$/example/handle_error.dart" />
<option value="$PROJECT_DIR$/test/routing_test.dart" />
<option value="$PROJECT_DIR$/test/server_test.dart" />
<option value="$PROJECT_DIR$/lib/src/http/angel_http.dart" />
<option value="$PROJECT_DIR$/example/main.dart" />
<option value="$PROJECT_DIR$/lib/src/core/server.dart" /> <option value="$PROJECT_DIR$/lib/src/core/server.dart" />
<option value="$PROJECT_DIR$/CHANGELOG.md" />
</list> </list>
</option> </option>
</component> </component>
@ -694,21 +701,7 @@
<workItem from="1534009494986" duration="594000" /> <workItem from="1534009494986" duration="594000" />
<workItem from="1534546784803" duration="353000" /> <workItem from="1534546784803" duration="353000" />
<workItem from="1534547885788" duration="9908000" /> <workItem from="1534547885788" duration="9908000" />
<workItem from="1534793956753" duration="4502000" /> <workItem from="1534793956753" duration="6517000" />
</task>
<task id="LOCAL-00101" summary="Patch">
<created>1531151957605</created>
<option name="number" value="00101" />
<option name="presentableId" value="LOCAL-00101" />
<option name="project" value="LOCAL" />
<updated>1531151957606</updated>
</task>
<task id="LOCAL-00102" summary="Bump">
<created>1531152011317</created>
<option name="number" value="00102" />
<option name="presentableId" value="LOCAL-00102" />
<option name="project" value="LOCAL" />
<updated>1531152011317</updated>
</task> </task>
<task id="LOCAL-00103" summary="Finalizers before sending"> <task id="LOCAL-00103" summary="Finalizers before sending">
<created>1531155020859</created> <created>1531155020859</created>
@ -1039,7 +1032,21 @@
<option name="project" value="LOCAL" /> <option name="project" value="LOCAL" />
<updated>1534798410411</updated> <updated>1534798410411</updated>
</task> </task>
<option name="localTasksCounter" value="150" /> <task id="LOCAL-00150" summary="Starts up, but is broken">
<created>1534798717707</created>
<option name="number" value="00150" />
<option name="presentableId" value="LOCAL-00150" />
<option name="project" value="LOCAL" />
<updated>1534798717707</updated>
</task>
<task id="LOCAL-00151" summary="Routable.use only accepts a Service">
<created>1534812824990</created>
<option name="number" value="00151" />
<option name="presentableId" value="LOCAL-00151" />
<option name="project" value="LOCAL" />
<updated>1534812824990</updated>
</task>
<option name="localTasksCounter" value="152" />
<servers /> <servers />
</component> </component>
<component name="TestHistory"> <component name="TestHistory">
@ -1075,7 +1082,7 @@
</history-entry> </history-entry>
</component> </component>
<component name="TimeTrackingManager"> <component name="TimeTrackingManager">
<option name="totallyTimeSpent" value="176709000" /> <option name="totallyTimeSpent" value="178724000" />
</component> </component>
<component name="TodoView"> <component name="TodoView">
<todo-panel id="selected-file"> <todo-panel id="selected-file">
@ -1138,8 +1145,6 @@
</component> </component>
<component name="VcsManagerConfiguration"> <component name="VcsManagerConfiguration">
<option name="CHECK_CODE_SMELLS_BEFORE_PROJECT_COMMIT" value="false" /> <option name="CHECK_CODE_SMELLS_BEFORE_PROJECT_COMMIT" value="false" />
<MESSAGE value="Upgrade combinator dependency" />
<MESSAGE value="Upgrade body_parser dependency" />
<MESSAGE value="Update description" /> <MESSAGE value="Update description" />
<MESSAGE value="Completely removed the `AngelBase` class" /> <MESSAGE value="Completely removed the `AngelBase` class" />
<MESSAGE value="Remove all usage of dart2_constant" /> <MESSAGE value="Remove all usage of dart2_constant" />
@ -1163,7 +1168,9 @@
<MESSAGE value="Force all handlers to (req, res) { ... }" /> <MESSAGE value="Force all handlers to (req, res) { ... }" />
<MESSAGE value="Move all existing handlers to (req, res) or IoC-based" /> <MESSAGE value="Move all existing handlers to (req, res) or IoC-based" />
<MESSAGE value="Removed debug property" /> <MESSAGE value="Removed debug property" />
<option name="LAST_COMMIT_MESSAGE" value="Removed debug property" /> <MESSAGE value="Starts up, but is broken" />
<MESSAGE value="Routable.use only accepts a Service" />
<option name="LAST_COMMIT_MESSAGE" value="Routable.use only accepts a Service" />
</component> </component>
<component name="XDebuggerManager"> <component name="XDebuggerManager">
<breakpoint-manager> <breakpoint-manager>
@ -1171,37 +1178,6 @@
</breakpoint-manager> </breakpoint-manager>
</component> </component>
<component name="editorHistoryManager"> <component name="editorHistoryManager">
<entry file="file://$USER_HOME$/.pub-cache/hosted/pub.dartlang.org/http_parser-3.1.3/lib/src/media_type.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="235">
<caret line="75" column="7" lean-forward="true" selection-start-line="75" selection-start-column="7" selection-end-line="75" selection-end-column="7" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/test/exception_test.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="176">
<caret line="61" lean-forward="true" selection-start-line="61" selection-end-line="61" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/lib/src/http/http.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="192">
<caret line="21" column="34" lean-forward="true" selection-start-line="21" selection-start-column="34" selection-end-line="21" selection-end-column="34" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/lib/hooks.dart" />
<entry file="file://$PROJECT_DIR$/lib/common.dart" />
<entry file="file://$PROJECT_DIR$/test/typed_service_test.dart" />
<entry file="file://$PROJECT_DIR$/test/services_test.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="438">
<caret line="105" column="35" selection-start-line="105" selection-start-column="35" selection-end-line="105" selection-end-column="35" />
</state>
</provider>
</entry>
<entry file="file://$USER_HOME$/.pub-cache/hosted/pub.dartlang.org/angel_container-1.0.0-alpha/lib/src/mirrors/reflector.dart"> <entry file="file://$USER_HOME$/.pub-cache/hosted/pub.dartlang.org/angel_container-1.0.0-alpha/lib/src/mirrors/reflector.dart">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="96"> <state relative-caret-position="96">
@ -1260,13 +1236,6 @@
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/example/handle_error.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="48">
<caret line="7" column="52" selection-start-line="7" selection-start-column="52" selection-end-line="7" selection-end-column="52" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/pubspec.yaml"> <entry file="file://$PROJECT_DIR$/pubspec.yaml">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="69"> <state relative-caret-position="69">
@ -1274,16 +1243,6 @@
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/lib/src/http/http_request_context.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="262">
<caret line="136" column="11" lean-forward="true" selection-start-line="136" selection-start-column="11" selection-end-line="136" selection-end-column="11" />
<folding>
<element signature="e#0#20#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$USER_HOME$/.pub-cache/hosted/pub.dartlang.org/angel_container-1.0.0-alpha.1/lib/src/container.dart"> <entry file="file://$USER_HOME$/.pub-cache/hosted/pub.dartlang.org/angel_container-1.0.0-alpha.1/lib/src/container.dart">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="406"> <state relative-caret-position="406">
@ -1291,16 +1250,6 @@
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/lib/src/core/routable.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-394">
<caret line="98" column="26" selection-start-line="98" selection-start-column="26" selection-end-line="98" selection-end-column="26" />
<folding>
<element signature="e#40#60#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/example/json.dart"> <entry file="file://$PROJECT_DIR$/example/json.dart">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="203"> <state relative-caret-position="203">
@ -1345,13 +1294,6 @@
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/lib/src/core/hooked_service.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-3259">
<caret line="6" column="21" selection-start-line="6" selection-start-column="21" selection-end-line="6" selection-end-column="21" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/test/serialize_test.dart"> <entry file="file://$PROJECT_DIR$/test/serialize_test.dart">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="176"> <state relative-caret-position="176">
@ -1366,16 +1308,6 @@
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/example/main.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="342">
<caret line="33" column="29" selection-start-line="33" selection-start-column="29" selection-end-line="33" selection-end-column="29" />
<folding>
<element signature="e#0#46#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/test/parameter_meta_test.dart"> <entry file="file://$PROJECT_DIR$/test/parameter_meta_test.dart">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-667"> <state relative-caret-position="-667">
@ -1411,13 +1343,6 @@
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/test/routing_test.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-1528">
<caret line="64" column="51" lean-forward="true" selection-start-line="64" selection-start-column="51" selection-end-line="64" selection-end-column="51" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/performance/hello/main.dart"> <entry file="file://$PROJECT_DIR$/performance/hello/main.dart">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="294"> <state relative-caret-position="294">
@ -1449,13 +1374,6 @@
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/test/server_test.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="204">
<caret line="92" column="31" selection-start-line="92" selection-start-column="31" selection-end-line="92" selection-end-column="31" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/test/primitives_test.dart"> <entry file="file://$PROJECT_DIR$/test/primitives_test.dart">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="128"> <state relative-caret-position="128">
@ -1487,43 +1405,153 @@
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/CHANGELOG.md"> <entry file="file://$USER_HOME$/.pub-cache/hosted/pub.dartlang.org/http_parser-3.1.3/lib/src/utils.dart">
<provider selected="true" editor-type-id="split-provider[text-editor;markdown-preview-editor]"> <provider selected="true" editor-type-id="text-editor">
<state split_layout="SPLIT"> <state relative-caret-position="181">
<first_editor relative-caret-position="329"> <caret line="14" column="4" selection-start-line="14" selection-start-column="4" selection-end-line="14" selection-end-column="4" />
<caret line="47" column="21" selection-start-line="47" selection-start-column="21" selection-end-line="47" selection-end-column="21" />
</first_editor>
<second_editor />
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/lib/src/http/angel_http.dart"> <entry file="file://$USER_HOME$/.pub-cache/hosted/pub.dartlang.org/http_parser-3.1.3/lib/src/media_type.dart">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="166"> <state relative-caret-position="129">
<caret line="64" column="7" selection-start-line="64" selection-start-column="7" selection-end-line="64" selection-end-column="7" /> <caret line="45" column="11" selection-start-line="45" selection-start-column="11" selection-end-line="45" selection-end-column="11" />
</state>
</provider>
</entry>
<entry file="file:///usr/local/opt/dart/libexec/lib/collection/list.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="129">
<caret line="217" column="21" selection-start-line="217" selection-start-column="21" selection-end-line="217" selection-end-column="21" />
</state>
</provider>
</entry>
<entry file="file://$USER_HOME$/.pub-cache/hosted/pub.dartlang.org/angel_route-3.0.0/lib/src/symlink_route.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="64">
<caret line="4" column="6" selection-start-line="4" selection-start-column="6" selection-end-line="4" selection-end-column="6" />
</state>
</provider>
</entry>
<entry file="file://$USER_HOME$/.pub-cache/hosted/pub.dartlang.org/angel_route-3.0.0/lib/src/router.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="97">
<caret line="42" column="28" lean-forward="true" selection-start-line="42" selection-start-column="28" selection-end-line="42" selection-end-column="28" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/lib/src/http/http_request_context.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="262">
<caret line="96" column="14" selection-start-line="96" selection-start-column="14" selection-end-line="96" selection-end-column="14" />
<folding> <folding>
<element signature="e#0#20#0" expanded="true" /> <element signature="e#0#20#0" expanded="true" />
</folding> </folding>
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/lib/src/core/hooked_service.dart">
<provider selected="true" editor-type-id="text-editor">
<state>
<caret column="43" selection-start-column="43" selection-end-column="43" />
<folding>
<element signature="e#31#51#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/lib/src/core/routable.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="886">
<caret line="94" column="16" selection-start-line="94" selection-start-column="16" selection-end-line="94" selection-end-column="16" />
<folding>
<element signature="e#40#60#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/lib/src/http/controller.dart"> <entry file="file://$PROJECT_DIR$/lib/src/http/controller.dart">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-1153"> <state relative-caret-position="-369">
<caret line="16" lean-forward="true" selection-start-line="16" selection-end-line="16" /> <caret line="45" column="34" lean-forward="true" selection-start-line="45" selection-start-column="34" selection-end-line="45" selection-end-column="34" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/example/handle_error.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="112">
<caret line="11" column="15" selection-start-line="11" selection-start-column="15" selection-end-line="11" selection-end-column="15" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/test/routing_test.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="149">
<caret line="103" column="31" selection-start-line="103" selection-start-column="31" selection-end-line="103" selection-end-column="31" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/test/server_test.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="160">
<caret line="18" column="17" selection-start-line="18" selection-start-column="17" selection-end-line="18" selection-end-column="17" />
</state>
</provider>
</entry>
<entry file="file:///usr/local/opt/dart/libexec/lib/async/future_impl.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="129">
<caret line="128" column="17" selection-start-line="128" selection-start-column="17" selection-end-line="128" selection-end-column="17" />
</state>
</provider>
</entry>
<entry file="file:///usr/local/opt/dart/libexec/lib/async/zone.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="129">
<caret line="1378" column="53" selection-start-line="1378" selection-start-column="53" selection-end-line="1378" selection-end-column="53" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/example/main.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="54">
<caret line="4" column="19" selection-start-line="4" selection-start-column="19" selection-end-line="4" selection-end-column="19" />
<folding>
<element signature="e#0#46#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/lib/src/http/angel_http.dart">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-140">
<caret line="163" column="31" lean-forward="true" selection-start-line="163" selection-start-column="31" selection-end-line="163" selection-end-column="31" />
<folding>
<element signature="e#0#20#0" expanded="true" />
</folding>
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/lib/src/core/server.dart"> <entry file="file://$PROJECT_DIR$/lib/src/core/server.dart">
<provider selected="true" editor-type-id="text-editor"> <provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="275"> <state relative-caret-position="406">
<caret line="363" column="45" selection-start-line="363" selection-start-column="45" selection-end-line="363" selection-end-column="45" /> <caret line="370" column="38" selection-start-line="370" selection-start-column="38" selection-end-line="370" selection-end-column="38" />
<folding> <folding>
<element signature="e#38#58#0" expanded="true" /> <element signature="e#38#58#0" expanded="true" />
</folding> </folding>
</state> </state>
</provider> </provider>
</entry> </entry>
<entry file="file://$PROJECT_DIR$/CHANGELOG.md">
<provider selected="true" editor-type-id="split-provider[text-editor;markdown-preview-editor]">
<state split_layout="SPLIT">
<first_editor relative-caret-position="540">
<caret line="53" column="75" selection-start-line="53" selection-start-column="75" selection-end-line="53" selection-end-column="75" />
</first_editor>
<second_editor />
</state>
</provider>
</entry>
</component> </component>
<component name="masterDetails"> <component name="masterDetails">
<states> <states>

View file

@ -46,4 +46,9 @@ type-safe manner.
* Removed `RequestContext.grab`. * Removed `RequestContext.grab`.
* Removed `RequestContext.properties`. * Removed `RequestContext.properties`.
* Removed the defunct `debug` property where it still existed. * Removed the defunct `debug` property where it still existed.
* `Routable.use` now only accepts a `Service`. * `Routable.use` now only accepts a `Service`.
* The above change removes the concept of "nested apps," which are messy to maintain, and
not very elegant.
* Removed `Angel.createZoneForRequest`.
* Removed `Angel.defaultZoneCreator`.
* Added all flags to the `Angel` constructor, ex. `Angel.eagerParseBodies`.

View file

@ -9,7 +9,7 @@ main() async {
..logger = (new Logger('angel')..onRecord.listen(print)) ..logger = (new Logger('angel')..onRecord.listen(print))
..encoders.addAll({'gzip': gzip.encoder}); ..encoders.addAll({'gzip': gzip.encoder});
app.use(() => new Future.error('Throwing just because I feel like!')); app.fallback((req, res) => new Future.error('Throwing just because I feel like!'));
var http = new AngelHttp(app); var http = new AngelHttp(app);
var server = await http.startServer('127.0.0.1', 3000); var server = await http.startServer('127.0.0.1', 3000);

View file

@ -2,7 +2,9 @@ import 'package:angel_container/mirrors.dart';
import 'package:angel_framework/angel_framework.dart'; import 'package:angel_framework/angel_framework.dart';
main() async { main() async {
var app = new Angel(reflector: MirrorsReflector()); var app = new Angel(
reflector: MirrorsReflector(),
);
// Index route. Returns JSON. // Index route. Returns JSON.
app.get('/', (req, res) => res.write('Welcome to Angel!')); app.get('/', (req, res) => res.write('Welcome to Angel!'));

View file

@ -20,7 +20,7 @@ import 'response_context.dart';
import 'routable.dart'; import 'routable.dart';
import 'service.dart'; import 'service.dart';
final RegExp _straySlashes = new RegExp(r'(^/+)|(/+$)'); //final RegExp _straySlashes = new RegExp(r'(^/+)|(/+$)');
/// A function that configures an [Angel] server in some way. /// A function that configures an [Angel] server in some way.
typedef FutureOr AngelConfigurer(Angel app); typedef FutureOr AngelConfigurer(Angel app);
@ -47,15 +47,6 @@ class Angel extends Routable {
/// A global Map of converters that can transform responses bodies. /// A global Map of converters that can transform responses bodies.
final Map<String, Converter<List<int>, List<int>>> encoders = {}; final Map<String, Converter<List<int>, List<int>>> encoders = {};
/// A function that is called on every request to create a [Zone], A.K.A an asynchronous
/// execution context.
///
/// The utility of zones in Angel is to safely catch errors without crashing the application;
/// this also lets the driver wrap failures in instances of [AngelHttpException].
Future<ZoneSpecification> Function(
HttpRequest request, RequestContext req, ResponseContext res)
createZoneForRequest;
final Map<dynamic, InjectionRequest> _preContained = {}; final Map<dynamic, InjectionRequest> _preContained = {};
/// A middleware to inject a serialize on every request. /// A middleware to inject a serialize on every request.
@ -373,25 +364,17 @@ class Angel extends Routable {
return super.use(path, service)..app = this; return super.use(path, service)..app = this;
} }
Angel({@required Reflector reflector}) { Angel(
{@required Reflector reflector,
this.logger,
this.eagerParseRequestBodies: false,
this.allowMethodOverrides: true,
this.keepRawRequestBuffers: false,
this.serializer,
this.viewGenerator}) {
_container = new Container(reflector); _container = new Container(reflector);
bootstrapContainer(); bootstrapContainer();
// ignore: deprecated_member_use viewGenerator ??= noViewEngineConfigured;
createZoneForRequest = defaultZoneCreator; serializer ??= json.encode;
}
@deprecated
Future<ZoneSpecification> defaultZoneCreator(request, req, res) {
return new Future.value(
new ZoneSpecification(
print: (Zone self, ZoneDelegate parent, Zone zone, String line) {
if (logger != null) {
logger.info(line);
} else {
return parent.print(zone, line);
}
},
),
);
} }
} }

View file

@ -44,7 +44,7 @@ class Controller {
} }
var routable = new Routable(); var routable = new Routable();
app.use(exposeDecl.path, routable); app.mount(exposeDecl.path, routable);
TypeMirror typeMirror = reflectType(this.runtimeType); TypeMirror typeMirror = reflectType(this.runtimeType);
String name = exposeDecl.as?.isNotEmpty == true String name = exposeDecl.as?.isNotEmpty == true
? exposeDecl.as ? exposeDecl.as

View file

@ -67,14 +67,14 @@ main() {
return req.params; return req.params;
}); });
app.use('/nes', nested); app.mount('/nes', nested);
app.get('/meta', testMiddlewareMetadata); app.get('/meta', testMiddlewareMetadata);
app.get('/intercepted', (req, res) => 'This should not be shown', app.get('/intercepted', (req, res) => 'This should not be shown',
middleware: [interceptor]); middleware: [interceptor]);
app.get('/hello', (req, res) => 'world'); app.get('/hello', (req, res) => 'world');
app.get('/name/:first/last/:last', (req, res) => req.params); app.get('/name/:first/last/:last', (req, res) => req.params);
app.post('/lambda', (RequestContext req, res) => req.parseBody()); app.post('/lambda', (RequestContext req, res) => req.parseBody());
app.use('/todos/:id', todos); app.mount('/todos/:id', todos);
app app
.get('/greet/:name', .get('/greet/:name',
(RequestContext req, res) async => "Hello ${req.params['name']}") (RequestContext req, res) async => "Hello ${req.params['name']}")
@ -101,7 +101,7 @@ main() {
app.chain([write('a')]).chain([write('b'), write('c')]).get( app.chain([write('a')]).chain([write('b'), write('c')]).get(
'/chained', (req, res) => false); '/chained', (req, res) => false);
app.use('MJ'); app.fallback((req, res) => 'MJ');
app.dumpTree(header: "DUMPING ROUTES:", showMatchers: true); app.dumpTree(header: "DUMPING ROUTES:", showMatchers: true);

View file

@ -16,7 +16,7 @@ main() {
var parent = new Angel(reflector: MirrorsReflector()) var parent = new Angel(reflector: MirrorsReflector())
..configuration['two'] = 2; ..configuration['two'] = 2;
var child = new Angel(reflector: MirrorsReflector()); var child = new Angel(reflector: MirrorsReflector());
parent.use('/child', child); parent.mount('/child', child);
test('sets children', () { test('sets children', () {
expect(parent.children, contains(child)); expect(parent.children, contains(child));