Skip to content
This repository has been archived by the owner on Jun 1, 2022. It is now read-only.

Commit

Permalink
chore (esnext-aspnetcore and typescript-aspnetcore): Convert initial …
Browse files Browse the repository at this point in the history
…page to use MVC conventions

Changed starting page to use ASP.Net view conventions rather than using index.html
Changed directory & csproj names to make navigation easier
Updated readme.md in both TypeScript projects to better reflect dotnet useage
Rebuilt config.js in wwwroot to let bootstrap get a jquery 2.x version
  • Loading branch information
MarkStega committed Jun 28, 2016
1 parent 0d1e449 commit 4aca9eb
Show file tree
Hide file tree
Showing 160 changed files with 233 additions and 235 deletions.
4 changes: 2 additions & 2 deletions skeleton-esnext-aspnetcore/skeleton-esnext-aspnetcore.sln
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{2020AC68-78E
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{B7C5F4AE-7354-4122-89A5-2E1ADF8ADC10}"
ProjectSection(SolutionItems) = preProject
src\skeleton-navigation-esnext-vs\.gitignore = src\skeleton-navigation-esnext-vs\.gitignore
src\skeleton\.gitignore = src\skeleton\.gitignore
global.json = global.json
EndProjectSection
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "skeleton-navigation-esnext-vs", "src\skeleton-navigation-esnext-vs\skeleton-navigation-esnext-vs.xproj", "{4AAFD9A8-008C-4ADF-8089-90C6ED4B96E3}"
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "skeleton", "src\skeleton\skeleton.xproj", "{4AAFD9A8-008C-4ADF-8089-90C6ED4B96E3}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
using Microsoft.AspNetCore.Mvc;

namespace skeleton.Controllers
{
public class HomeController : Controller
{
public IActionResult Index()
{
return View();
}

public IActionResult Error()
{
return View();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using System.Threading.Tasks;
using Microsoft.AspNetCore.Hosting;

namespace skeleton_navigation_esnext_vs
namespace skeleton
{
public class Program
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:49859/",
"applicationUrl": "http://localhost:49860/",
"sslPort": 0
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,16 @@ To run the app, follow these steps.

```shell
gulp build
dotnet build
```

>**Note:** This skeleton is wrapped in an ASP.Net Core 1.0 RC2 project. If you are using VSCode on any platform you can install
>**Note:** This skeleton is wrapped in an ASP.Net Core 1.0 RTM project. If you are using VSCode on any platform you can install
ASP.Net Core on Windows, OSX, or Linux. The instructions to do so are found
[on this Microsoft page](https://www.microsoft.com/net/core).
This assumes you are running from command line but Visual Studio users should be familiar with how to build and run the project
in the IDE.

>**Note:** This project requires the installation of the ASP.Net Core SDK 1.0 RC2 as well as the ASP.Net Core VS2015 Tooling Preview 1.
>**Note:** To use this project in Visual Studio requires the installation of Visual Studio 2015 Update 3 as well as the ASP.Net Core VS2015 Tooling Preview 2.
They both may be found
[on this Microsoft page](https://www.microsoft.com/net/core#windows).

Expand All @@ -55,11 +56,11 @@ They both may be found
```shell
dotnet run
```
Or in Visual Studio just click on the Debug in the Browser option.
Or in Visual Studio just click on the Debug.Start Debugging (F5) or Debug.Start Without Debugging (Ctrl-F5) in the main menu..

9. If you want the changes you are making to be reflected in the browser you can run `gulp watch` in a second terminal window and refresh the page in your browser.

10. Browse to [http://localhost:9000](http://localhost:9000) to see the app. You can make changes in the code found under `src` and the browser should auto-refresh itself as you save files. (Note: It's possible that a port other than 9000 will be used if there's already something running there. Double check the port number to be sure.)
10. Browse to [http://localhost:5000](http://localhost:5000) to see the app. You can make changes in the code found under `src` and the browser should auto-refresh itself as you save files. (Note: It's possible that a port other than 5000 will be used if there's already something running there. Double check the port number shown on the console after the "dotnet run" to be sure.)

## Bundling

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.AspNetCore.Identity.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;

namespace skeleton_navigation_esnext_vs
namespace skeleton
{
public class Startup
{
Expand Down Expand Up @@ -38,8 +36,8 @@ public void ConfigureServices(IServiceCollection services)
// Add framework services.

services.AddApplicationInsightsTelemetry(Configuration);
// To enable Mvc, uncomment this line as well as the Mvc configuration in Configure below.
//services.AddMvc();

services.AddMvc();

// Add application services.
}
Expand All @@ -59,19 +57,17 @@ public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerF
{
app.UseExceptionHandler("/Home/Error");
}
// Comment this line to NOT use index.html as the startup file. For example, when using Mvc.
app.UseDefaultFiles();

app.UseStaticFiles();

// Add external authentication middleware below. To configure them please see http://go.microsoft.com/fwlink/?LinkID=532715
// Uncomment this line to use Mvc as the startup route.
//app.UseMvc(routes =>
//{
//routes.MapRoute(
//name: "default",
//template: "{controller=Home}/{action=Index}/{id?}");
//});

app.UseMvc(routes =>
{
routes.MapRoute(
name: "default",
template: "{controller=Home}/{action=Index}/{id?}");
});
}
}
}
13 changes: 13 additions & 0 deletions skeleton-esnext-aspnetcore/src/skeleton/appsettings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"ApplicationInsights": {
"InstrumentationKey": ""
},
"Logging": {
"IncludeScopes": false,
"LogLevel": {
"Default": "Verbose",
"System": "Information",
"Microsoft": "Information"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,10 @@
"font-awesome": "npm:[email protected]",
"text": "github:systemjs/plugin-text@^0.0.8"
},
"devDependencies": {}
"devDependencies": {
"babel": "npm:babel-core@^5.8.24",
"babel-runtime": "npm:babel-runtime@^5.8.24",
"core-js": "npm:core-js@^1.1.4"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.Props" Condition="'$(VSToolsPath)' != ''" />
<PropertyGroup Label="Globals">
<ProjectGuid>4aafd9a8-008c-4adf-8089-90c6ed4b96e3</ProjectGuid>
<RootNamespace>skeleton_navigation_typescript_vs</RootNamespace>
<RootNamespace>skeleton</RootNamespace>
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">.\obj</BaseIntermediateOutputPath>
<OutputPath Condition="'$(OutputPath)'=='' ">.\bin\</OutputPath>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
//import {computedFrom} from 'aurelia-framework';

export class Welcome {
heading = 'Welcome to the Aurelia Navigation App!';
heading = 'Welcome to the Aurelia Navigation App [skeleton-esnext-aspnetcore]!';
firstName = 'John';
lastName = 'Doe';
previousValue = this.fullName;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@{Layout = "_layout";}
14 changes: 14 additions & 0 deletions skeleton-esnext-aspnetcore/src/skeleton/views/home/Index.cshtml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<div aurelia-app="main">
<div class="splash">
<div class="message">Aurelia Navigation Skeleton</div>
<div class="fa fa-spinner fa-spin"></div>
</div>

<script src="jspm_packages/system.js"></script>

<script src="config.js"></script>

<script>
System.import('aurelia-bootstrapper');
</script>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>@ViewBag.Title</title>
<link rel="stylesheet" href="~/jspm_packages/npm/[email protected]/css/font-awesome.min.css" />
<link rel="stylesheet" href="~/styles/styles.css" />
@RenderSection("Styles", false)
</head>
<body>
<section id="main">
@RenderBody()
</section>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -1,20 +1,18 @@
System.config({
defaultJSExtensions: true,
transpiler: false,
transpiler: "babel",
babelOptions: {
"optional": [
"runtime",
"optimisation.modules.system"
]
},
paths: {
"*": "dist/*",
"github:*": "jspm_packages/github/*",
"npm:*": "jspm_packages/npm/*"
},

meta: {
"bootstrap": {
"deps": [
"jquery"
]
}
},

map: {
"aurelia-animator-css": "npm:[email protected]",
"aurelia-bootstrapper": "npm:[email protected]",
Expand All @@ -29,7 +27,10 @@ System.config({
"aurelia-templating-binding": "npm:[email protected]",
"aurelia-templating-resources": "npm:[email protected]",
"aurelia-templating-router": "npm:[email protected]",
"babel": "npm:[email protected]",
"babel-runtime": "npm:[email protected]",
"bootstrap": "github:twbs/[email protected]",
"core-js": "npm:[email protected]",
"fetch": "github:github/[email protected]",
"font-awesome": "npm:[email protected]",
"text": "github:systemjs/[email protected]",
Expand All @@ -39,6 +40,9 @@ System.config({
"github:jspm/[email protected]": {
"buffer": "npm:[email protected]"
},
"github:jspm/[email protected]": {
"path-browserify": "npm:[email protected]"
},
"github:jspm/[email protected]": {
"process": "npm:[email protected]"
},
Expand All @@ -49,7 +53,7 @@ System.config({
"vm-browserify": "npm:[email protected]"
},
"github:twbs/[email protected]": {
"jquery": "npm:jquery@3.0.0"
"jquery": "npm:jquery@2.2.4"
},
"npm:[email protected]": {
"assert": "github:jspm/[email protected]",
Expand Down Expand Up @@ -176,6 +180,9 @@ System.config({
"aurelia-path": "npm:[email protected]",
"aurelia-task-queue": "npm:[email protected]"
},
"npm:[email protected]": {
"process": "github:jspm/[email protected]"
},
"npm:[email protected]": {
"base64-js": "npm:[email protected]",
"child_process": "github:jspm/[email protected]",
Expand All @@ -184,13 +191,19 @@ System.config({
"isarray": "npm:[email protected]",
"process": "github:jspm/[email protected]"
},
"npm:[email protected]": {
"fs": "github:jspm/[email protected]",
"path": "github:jspm/[email protected]",
"process": "github:jspm/[email protected]",
"systemjs-json": "github:systemjs/[email protected]"
},
"npm:[email protected]": {
"css": "github:systemjs/[email protected]"
},
"npm:[email protected]": {
"util": "github:jspm/[email protected]"
},
"npm:jquery@3.0.0": {
"npm:path-browserify@0.0.0": {
"process": "github:jspm/[email protected]"
},
"npm:[email protected]": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{2020AC68-78E
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{B7C5F4AE-7354-4122-89A5-2E1ADF8ADC10}"
ProjectSection(SolutionItems) = preProject
src\skeleton-navigation-typescript-vs\.gitignore = src\skeleton-navigation-typescript-vs\.gitignore
src\skeleton\.gitignore = src\skeleton\.gitignore
global.json = global.json
EndProjectSection
EndProject
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "skeleton-navigation-typescript-vs", "src\skeleton-navigation-typescript-vs\skeleton-navigation-typescript-vs.xproj", "{4AAFD9A8-008C-4ADF-8089-90C6ED4B96E3}"
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "skeleton", "src\skeleton\skeleton.xproj", "{4AAFD9A8-008C-4ADF-8089-90C6ED4B96E3}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down
Loading

0 comments on commit 4aca9eb

Please sign in to comment.