Skip to content
This repository was archived by the owner on Jun 30, 2021. It is now read-only.

Commit 8343d71

Browse files
committed
Merge branch 'release/2.0'
2 parents 44a2746 + 19a79f1 commit 8343d71

283 files changed

Lines changed: 31683 additions & 1148 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,12 @@ UpgradeLog*.XML
113113
*.vs
114114

115115
# Temp CSS fix
116-
117116
*.map
118-
src/Examples/Simplify.Web.Examples.SelfHosted/Styles/*.css
119-
!src/Examples/Simplify.Web.Examples.SelfHosted/Styles/Main.min.css
117+
src/SampleApps/SampleApp.SelfHosted/Styles/*.css
118+
!src/SampleApps/SampleApp.SelfHosted/Styles/Main.min.css
119+
120+
# Dist ignore
121+
**/wwwroot/dist/
122+
123+
# Node modules
124+
node_modules/

.vscode/launch.json

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
"version": "0.2.0",
3+
"configurations": [
4+
{
5+
"name": "Simplify.Web.Examples.Kestrel Launch",
6+
"type": "coreclr",
7+
"request": "launch",
8+
"preLaunchTask": "Build Kestrel Example",
9+
"program": "${workspaceFolder}/src/Examples/Simplify.Web.Examples.Kestrel/bin/Debug/netcoreapp2.1/Simplify.Web.Examples.Kestrel.dll",
10+
"cwd": "${workspaceFolder}/src/Examples/Simplify.Web.Examples.Kestrel",
11+
"internalConsoleOptions": "openOnSessionStart",
12+
"env":
13+
{
14+
"ASPNETCORE_ENVIRONMENT": "Development"
15+
}
16+
},
17+
{
18+
"name": "Simplify.Web.Examples.SelfHosted Launch",
19+
"type": "coreclr",
20+
"request": "launch",
21+
"preLaunchTask": "Build SelfHosted Example",
22+
"program": "${workspaceFolder}/src/Examples/Simplify.Web.Examples.SelfHosted/bin/Debug/netcoreapp2.1/Simplify.Web.Examples.SelfHosted.dll",
23+
"cwd": "${workspaceFolder}/src/Examples/Simplify.Web.Examples.SelfHosted",
24+
"internalConsoleOptions": "openOnSessionStart",
25+
"env":
26+
{
27+
"ASPNETCORE_ENVIRONMENT": "Development"
28+
}
29+
},
30+
{
31+
"name": ".NET Core Attach",
32+
"type": "coreclr",
33+
"request": "attach",
34+
"processId": "${command:pickProcess}"
35+
}]
36+
}

.vscode/tasks.json

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
{
2+
"version": "2.0.0",
3+
"tasks": [
4+
{
5+
"label": "Build Kestrel Example",
6+
"command": "dotnet",
7+
"type": "process",
8+
"args": [
9+
"build",
10+
"${workspaceFolder}/src/Examples/Simplify.Web.Examples.Kestrel/Simplify.Web.Examples.Kestrel.csproj"
11+
],
12+
"problemMatcher": "$msCompile"
13+
},
14+
{
15+
"label": "Build SelfHosted Example",
16+
"command": "dotnet",
17+
"type": "process",
18+
"args": [
19+
"build",
20+
"${workspaceFolder}/src/Examples/Simplify.Web.Examples.SelfHosted/Simplify.Web.Examples.SelfHosted.csproj"
21+
],
22+
"problemMatcher": "$msCompile"
23+
},
24+
{
25+
"label": "Build",
26+
"command": "dotnet",
27+
"type": "process",
28+
"args": [
29+
"build",
30+
"${workspaceFolder}/src/Simplify.Web.sln"
31+
],
32+
"problemMatcher": "$msCompile",
33+
"group":
34+
{
35+
"kind": "build",
36+
"isDefault": true
37+
}
38+
}]
39+
}

README.md

Lines changed: 46 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ _This project is a continuator of [AcspNet web-framework](https://github.com/i40
88

99
## Package status
1010

11-
| Latest version | [![Nuget version](http://img.shields.io/badge/nuget-v1.3-blue.png)](https://www.nuget.org/packages/Simplify.Web/) |
11+
| Latest version | [![Nuget version](http://img.shields.io/badge/nuget-v2.0-blue.png)](https://www.nuget.org/packages/Simplify.Web/) |
1212
| :------ | :------: |
1313
| **Dependencies** | [![NuGet Status](http://nugetstatus.com/Simplify.Web.png)](http://nugetstatus.com/packages/Simplify.Web) |
1414

@@ -20,34 +20,42 @@ _This project is a continuator of [AcspNet web-framework](https://github.com/i40
2020

2121
## Build status
2222

23-
| Branch | **.NET (4.5.2)** |
23+
| Branch | **.NET (4.6.2)** |
2424
| :------ | :------ |
2525
| **master** | [![AppVeyor Build status](https://ci.appveyor.com/api/projects/status/sln1ciuam2hobsv4/branch/master?svg=true)](https://ci.appveyor.com/project/i4004/simplify-web/branch/master) |
2626
| **develop** | [![AppVeyor Build status](https://ci.appveyor.com/api/projects/status/sln1ciuam2hobsv4/branch/develop?svg=true)](https://ci.appveyor.com/project/i4004/simplify-web/branch/develop) |
2727

2828
## Main features
2929

30+
* Comes as Microsoft.AspNetCore OWIN middleware
31+
* Can be used as an API backend only with other front-end frameworks
3032
* Based on MVC and MVVM patterns
31-
* Comes as OWIN middleware
33+
* Lightweigh & Fast
3234
* Uses switchable IOC container for itself and controllers, views constructor injection ([Simplify.DI](https://github.com/i4004/Simplify/wiki/Simplify.DI))
33-
* Mono-friendly
3435
* Support async controllers
35-
* Uses fast templates engine ([Simplify.Templates](https://github.com/i4004/Simplify/wiki/Simplify.Templates))
3636
* Supports controllers which can be run on any page
3737
* Localization-friendly (supports templates, string table and data files localization by default)
38+
* Uses fast templates engine ([Simplify.Templates](https://github.com/i4004/Simplify/wiki/Simplify.Templates))
3839
* Mocking-friendly
40+
* Mono-friendly
3941

4042
## Getting started
4143

42-
<!----To get started you can install [visual studio Simplify.Web project templates](http://visualstudiogallery.msdn.microsoft.com/25a4534d-5a5b-4cce-aecf-523c3679a1c3) and read [this](https://github.com/i4004/Simplify.Web/wiki/Getting-started) article.-->
44+
Below is the list of sample applications showing different variations of Simplify.Web usage
4345

44-
### The examples below shows simple backend HTML generation, but you can easily use any front end technologies with Simplify.Web like AngularJS etc.
46+
* [Only as an API backend with Angular + Bootstrap UI SPA](https://github.com/i4004/Simplify/tree/master/src/SampleApps/SampleApp.Angular)
47+
* [Very simple Kestrel-based Application with backend page](https://github.com/i4004/Simplify/tree/master/src/SampleApps/SampleApp.Kestrel)
48+
* [Kestrel-based Application with backend HTML generation, localization, authentication](https://github.com/i4004/Simplify/tree/master/src/SampleApps/SampleApp.SelfHosted)
49+
* [Only as an API backend with Vue.js + Bootstrap UI SPA](https://github.com/i4004/Simplify/tree/master/src/SampleApps/SampleApp.Vue)
50+
* [Only as an API backend with Vue.js + Element UI SPA](https://github.com/i4004/Simplify/tree/master/src/SampleApps/SampleApp.Vue.Element)
51+
* [Very simple Kestrel-based Application hosted as windows-service](https://github.com/i4004/Simplify/tree/master/src/SampleApps/SampleApp.WindowsServiceHosted)
4552

4653
[Getting started page](https://github.com/i4004/Simplify.Web/wiki/Getting-started)
4754

48-
## Some examples
55+
### Just some simple controllers example
4956

5057
#### Simple static page controller
58+
5159
```csharp
5260
// Controller will be executed only on HTTP GET request like http://mysite.com/about
5361
[Get("about")]
@@ -61,8 +69,37 @@ public class AboutController : Controller
6169
}
6270
```
6371

72+
#### API controller example
73+
74+
```csharp
75+
[Get("api/weatherTypes")]
76+
public class SampleDataController : Controller
77+
{
78+
private static readonly string[] Summaries =
79+
{
80+
"Freezing", "Bracing", "Chilly", "Cool", "Mild", "Warm", "Balmy", "Hot", "Sweltering", "Scorching"
81+
};
82+
83+
public override ControllerResponse Invoke()
84+
{
85+
try
86+
{
87+
return new Json(items);
88+
}
89+
catch (Exception e)
90+
{
91+
Console.WriteLine(e);
92+
93+
return StatusCode(500);
94+
}
95+
}
96+
}
97+
```
98+
6499
#### Any page controller with high run priority example
100+
65101
Runs on any request and adds login panel to a pages
102+
66103
```csharp
67104
// Controller will be executed on any request and will be launched before other controllers (because they have Priority = 0 by default)
68105
[Priority(-1)]
@@ -80,6 +117,7 @@ public class LoginPanelController : AsyncController
80117
```
81118

82119
#### View example
120+
83121
```csharp
84122
public class LoggedUserPanelView : View
85123
{
@@ -96,27 +134,4 @@ public class LoggedUserPanelView : View
96134
}
97135
```
98136

99-
#### Templates example
100-
101-
##### Master.tpl
102-
```html
103-
<!DOCTYPE html>
104-
<html>
105-
<head>
106-
<title>{Title}</title>
107-
</head>
108-
<body>
109-
{MainContent}
110-
</body>
111-
</html>
112-
```
113-
114-
##### About.tpl
115-
116-
```html
117-
<div class="container">
118-
Welcome to about page!
119-
</div>
120-
```
121-
122137
### [Detailed documentation](https://github.com/i4004/Simplify.Web/wiki)

RunTests.ps1

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
$config = "release"
2+
$excludeProjects = @()
3+
4+
$excludeProjectsRegex = [string]::Join('|', $excludeProjects)
5+
6+
# Find each test project and run tests and upload results to AppVeyor
7+
Get-ChildItem .\**\*.csproj -Recurse |
8+
Where-Object { ($_.Name -match ".*Test(s)?.csproj$") -and (($_.Name -notmatch $excludeProjectsRegex) -or ($excludeProjects.length -eq 0)) } |
9+
ForEach-Object {
10+
11+
$testResultPath = (Get-Item -Path ".\").FullName + "\test-result.trx"
12+
$loggerParameters = "trx;LogFileName=" + $testResultPath
13+
14+
# Run dotnet test on the project and output the results in mstest format (also works for other frameworks like nunit)
15+
& dotnet test $_.FullName --configuration $config --no-build --no-restore --logger $loggerParameters
16+
17+
# if on build server upload results to AppVeyor
18+
if ("${ENV:APPVEYOR_JOB_ID}" -ne "")
19+
{
20+
"Uploading test results to AppVeyor..."
21+
22+
$wc = New-Object 'System.Net.WebClient'
23+
$wc.UploadFile("https://ci.appveyor.com/api/testresults/mstest/$($env:APPVEYOR_JOB_ID)", $testResultPath)
24+
}
25+
26+
# don't leave the test results lying around
27+
Remove-Item $testResultPath -ErrorAction SilentlyContinue
28+
}

appveyor.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,7 @@ before_build:
1414
build:
1515
publish_nuget: true
1616
parallel: true
17-
verbosity: minimal
17+
verbosity: minimal
18+
19+
test_script:
20+
- ps: .\RunTests.ps1

src/.nuget/NuGet.exe

606 KB
Binary file not shown.

src/Examples/Simplify.Web.Examples.Katana/Controllers/DefaultController.cs

Lines changed: 0 additions & 14 deletions
This file was deleted.

src/Examples/Simplify.Web.Examples.Katana/Simplify.Web.Examples.Katana.csproj

Lines changed: 0 additions & 18 deletions
This file was deleted.

src/Examples/Simplify.Web.Examples.Katana/Startup.cs

Lines changed: 0 additions & 17 deletions
This file was deleted.

0 commit comments

Comments
 (0)