Skip to content

Commit

Permalink
#43: move static files to wwwroot
Browse files Browse the repository at this point in the history
  • Loading branch information
ForNeVeR committed Apr 16, 2017
1 parent 46133d9 commit c287e39
Show file tree
Hide file tree
Showing 17 changed files with 8 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Expand Up @@ -7,4 +7,4 @@ obj/

*.user

/ForneverMind/app/
/ForneverMind/wwwroot/app/
4 changes: 2 additions & 2 deletions .gitmodules
@@ -1,6 +1,6 @@
[submodule "ForneverMind/talks/modern-programming"]
path = ForneverMind/talks/modern-programming
path = ForneverMind/wwwroot/talks/modern-programming
url = https://github.com/ForNeVeR/modern-programming.git
[submodule "ForneverMind/talks/net-core-slides"]
path = ForneverMind/talks/net-core-slides
path = ForneverMind/wwwroot/talks/net-core-slides
url = https://github.com/ForNeVeR/net-core-slides.git
2 changes: 1 addition & 1 deletion ForneverMind.Frontend/webpack.config.js
@@ -1,7 +1,7 @@
const ExtractTextPlugin = require("extract-text-webpack-plugin");
const path = require('path');

const outputPath = path.join(__dirname, '..', 'ForneverMind', 'app');
const outputPath = path.join(__dirname, '..', 'ForneverMind', 'wwwroot', 'app');

module.exports = {
resolve: { extensions: ['', '.js', '.less'] },
Expand Down
3 changes: 2 additions & 1 deletion ForneverMind/KestrelInterop.fs
Expand Up @@ -20,7 +20,8 @@ module ApplicationBuilder =

module WebHost =
let private root = Directory.GetCurrentDirectory()
let create () = WebHostBuilder().UseContentRoot(root).UseKestrel()
let private webRoot = Path.Combine(root, "wwwroot")
let create () = WebHostBuilder().UseContentRoot(root).UseWebRoot(webRoot).UseKestrel()
let bindTo urls (b:IWebHostBuilder) = b.UseUrls urls
let configure ({ application = application; logging = logging }) (b:IWebHostBuilder) =
b.ConfigureLogging(Action<_> logging)
Expand Down
4 changes: 1 addition & 3 deletions ForneverMind/Program.fs
Expand Up @@ -19,9 +19,7 @@ let private createRouter (builder : IApplicationBuilder) =
routesModule.Router

let private useStaticFiles (app : IApplicationBuilder) =
app.UseStaticFiles("/app")
.UseStaticFiles("/images")
.UseStaticFiles("/talks")
app.UseStaticFiles()

let private configureApplication app =
let router = createRouter app
Expand Down
3 changes: 1 addition & 2 deletions ForneverMind/views/_Layout.cshtml
Expand Up @@ -3,8 +3,7 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<title>F. von Never — @ViewBag.Title</title>
<!--<base href="System.Configuration.ConfigurationManager.AppSettings["BaseUrl"]"/>
TODO[F]: Fix base url determination here. -->
<base href="/"/>
<link rel="alternate" type="application/rss+xml" href="./rss.xml" title="RSS Feed"/>
<link rel="stylesheet" type="text/css" href="app/app.css"/>
<script src="app/app.js" async></script>
Expand Down

0 comments on commit c287e39

Please sign in to comment.