Skip to content

Commit

Permalink
initial version
Browse files Browse the repository at this point in the history
  • Loading branch information
johnwu1114 committed Apr 24, 2017
0 parents commit a545658
Show file tree
Hide file tree
Showing 15 changed files with 228 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .gitignore
@@ -0,0 +1,7 @@
.DS_Store
Thumbs.db
.vs/
bin/
obj/
node_modules/
*.log
22 changes: 22 additions & 0 deletions MyWebsite.sln
@@ -0,0 +1,22 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.26228.10
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MyWebsite", "MyWebsite\MyWebsite.csproj", "{CE02962B-3EB1-4E29-B676-09510FAF86B6}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{CE02962B-3EB1-4E29-B676-09510FAF86B6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{CE02962B-3EB1-4E29-B676-09510FAF86B6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{CE02962B-3EB1-4E29-B676-09510FAF86B6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{CE02962B-3EB1-4E29-B676-09510FAF86B6}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
EndGlobal
27 changes: 27 additions & 0 deletions MyWebsite/MyWebsite.csproj
@@ -0,0 +1,27 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>netcoreapp1.1</TargetFramework>
<Authors>John Wu</Authors>
<PackageRequireLicenseAcceptance>False</PackageRequireLicenseAcceptance>
<ApplicationIcon>wwwroot\favicon.ico</ApplicationIcon>
<Copyright>Copyright © 2017 John Wu</Copyright>
<Description>This is example for ASP.NET Core from blog.johnwu.cc</Description>
<Company />
</PropertyGroup>

<ItemGroup>
<Content Include="wwwroot\app\app.component.html" />
<Content Include="wwwroot\app\app.component.ts" />
<Content Include="wwwroot\app\main.ts" />
<Content Include="wwwroot\favicon.ico" />
<Content Include="wwwroot\index.html" />
<Content Include="wwwroot\systemjs.config.js" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.ApplicationInsights.AspNetCore" Version="2.0.0" />
<PackageReference Include="Microsoft.AspNetCore" Version="1.1.1" />
<PackageReference Include="Microsoft.AspNetCore.StaticFiles" Version="1.1.1" />
</ItemGroup>
</Project>
21 changes: 21 additions & 0 deletions MyWebsite/Program.cs
@@ -0,0 +1,21 @@
using Microsoft.AspNetCore.Hosting;
using System.IO;

namespace MyWebsite
{
public class Program
{
public static void Main(string[] args)
{
var host = new WebHostBuilder()
.UseKestrel()
.UseContentRoot(Directory.GetCurrentDirectory())
.UseIISIntegration()
.UseStartup<Startup>()
.UseApplicationInsights()
.Build();

host.Run();
}
}
}
16 changes: 16 additions & 0 deletions MyWebsite/Properties/launchSettings.json
@@ -0,0 +1,16 @@
{
"iisSettings": {
"windowsAuthentication": false,
"anonymousAuthentication": true,
"iisExpress": {
"applicationUrl": "http://localhost:33333/",
"sslPort": 0
}
},
"profiles": {
"IIS Express": {
"commandName": "IISExpress",
"launchBrowser": true
}
}
}
22 changes: 22 additions & 0 deletions MyWebsite/Startup.cs
@@ -0,0 +1,22 @@
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.FileProviders;
using System.IO;

namespace MyWebsite
{
public class Startup
{
public void Configure(IApplicationBuilder app)
{
app.UseDefaultFiles();
app.UseStaticFiles();
app.UseStaticFiles(new StaticFileOptions()
{
FileProvider = new PhysicalFileProvider(
Path.Combine(Directory.GetCurrentDirectory(), @"node_modules")),
RequestPath = new PathString("/node_modules")
});
}
}
}
24 changes: 24 additions & 0 deletions MyWebsite/package.json
@@ -0,0 +1,24 @@
{
"name": "my-website",
"version": "1.0.0",
"description": "This is example for Angular 4 from blog.johnwu.cc",
"dependencies": {
"@angular/common": "4.0.2",
"@angular/compiler": "4.0.2",
"@angular/core": "4.0.2",
"@angular/forms": "4.0.2",
"@angular/http": "4.0.2",
"@angular/platform-browser": "4.0.2",
"@angular/platform-browser-dynamic": "4.0.2",
"@angular/router": "4.0.2",
"core-js": "2.4.1",
"rxjs": "5.3.0",
"systemjs": "0.20.12",
"zone.js": "0.8.5"
},
"devDependencies": {
"@types/jasmine": "2.5.47",
"@types/node": "7.0.12",
"typescript": "2.2.2"
}
}
17 changes: 17 additions & 0 deletions MyWebsite/tsconfig.json
@@ -0,0 +1,17 @@
{
"compileOnSave": true,
"compilerOptions": {
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"lib": [ "es2015", "dom" ],
"module": "commonjs",
"moduleResolution": "node",
"noImplicitAny": true,
"sourceMap": true,
"suppressImplicitAnyIndexErrors": true,
"target": "es5"
},
"exclude": [
"node_modules"
]
}
2 changes: 2 additions & 0 deletions MyWebsite/wwwroot/app/.gitignore
@@ -0,0 +1,2 @@
*.js
*.map
1 change: 1 addition & 0 deletions MyWebsite/wwwroot/app/app.component.html
@@ -0,0 +1 @@
<h1>Hello {{name}}</h1>
9 changes: 9 additions & 0 deletions MyWebsite/wwwroot/app/app.component.ts
@@ -0,0 +1,9 @@
import { Component } from "@angular/core";

@Component({
selector: "my-app",
templateUrl: "/app/app.component.html"
})
export class AppComponent {
name = "Angular 4";
}
13 changes: 13 additions & 0 deletions MyWebsite/wwwroot/app/main.ts
@@ -0,0 +1,13 @@
import { platformBrowserDynamic } from "@angular/platform-browser-dynamic";
import { NgModule } from "@angular/core";
import { BrowserModule } from "@angular/platform-browser";
import { AppComponent } from "./app.component";

@NgModule({
imports: [BrowserModule],
declarations: [AppComponent],
bootstrap: [AppComponent]
})
export class AppModule { }

platformBrowserDynamic().bootstrapModule(AppModule);
Binary file added MyWebsite/wwwroot/favicon.ico
Binary file not shown.
20 changes: 20 additions & 0 deletions MyWebsite/wwwroot/index.html
@@ -0,0 +1,20 @@
<!DOCTYPE html>
<html>
<head>
<title>MyWebsite</title>
<base href="/">
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<script src="/node_modules/core-js/client/shim.min.js"></script>
<script src="/node_modules/zone.js/dist/zone.js"></script>
<script src="/node_modules/systemjs/dist/system.src.js"></script>
<script src="/systemjs.config.js"></script>
<script>
System.import('/app/main.js').catch(function (err) { console.error(err); });
</script>
</head>

<body>
<my-app>Loading AppComponent content here ...</my-app>
</body>
</html>
27 changes: 27 additions & 0 deletions MyWebsite/wwwroot/systemjs.config.js
@@ -0,0 +1,27 @@
(function (global) {
System.config({
paths: {
"npm:": "node_modules/"
},
map: {
"app": "app",
"@angular/core": "npm:@angular/core/bundles/core.umd.js",
"@angular/common": "npm:@angular/common/bundles/common.umd.js",
"@angular/compiler": "npm:@angular/compiler/bundles/compiler.umd.js",
"@angular/platform-browser": "npm:@angular/platform-browser/bundles/platform-browser.umd.js",
"@angular/platform-browser-dynamic": "npm:@angular/platform-browser-dynamic/bundles/platform-browser-dynamic.umd.js",
"@angular/http": "npm:@angular/http/bundles/http.umd.js",
"@angular/router": "npm:@angular/router/bundles/router.umd.js",
"@angular/forms": "npm:@angular/forms/bundles/forms.umd.js",
"rxjs": "npm:rxjs",
},
packages: {
app: {
defaultExtension: "js",
},
rxjs: {
defaultExtension: "js"
}
}
});
})(this);

0 comments on commit a545658

Please sign in to comment.