start up work

IndexWait was using the wrong run helper; wrote code to serve theme
content under [theme-name]/; set view files to copy on build
This commit is contained in:
Daniel J. Summers 2016-07-13 07:56:07 -05:00
parent 84e6e856f5
commit 61d37c0530
3 changed files with 69 additions and 23 deletions

View File

@ -48,7 +48,7 @@ let createIndex cfg table index =
|> runResultAsync cfg.conn |> runResultAsync cfg.conn
|> ignore |> ignore
(tbl cfg table).IndexWait(index) (tbl cfg table).IndexWait(index)
|> runResultAsync cfg.conn |> runAtomAsync cfg.conn
|> ignore |> ignore
logStepDone () logStepDone ()
@ -79,7 +79,7 @@ let checkPageIndexes cfg =
|> runResultAsync cfg.conn |> runResultAsync cfg.conn
|> ignore |> ignore
(tbl cfg Table.Page).IndexWait "permalink" (tbl cfg Table.Page).IndexWait "permalink"
|> runResultAsync cfg.conn |> runAtomAsync cfg.conn
|> ignore |> ignore
logStepDone () logStepDone ()
match idx.Contains "pageList" with match idx.Contains "pageList" with
@ -90,7 +90,7 @@ let checkPageIndexes cfg =
|> runResultAsync cfg.conn |> runResultAsync cfg.conn
|> ignore |> ignore
(tbl cfg Table.Page).IndexWait "pageList" (tbl cfg Table.Page).IndexWait "pageList"
|> runResultAsync cfg.conn |> runAtomAsync cfg.conn
|> ignore |> ignore
logStepDone () logStepDone ()
@ -104,7 +104,7 @@ let checkPostIndexes cfg =
|> runResultAsync cfg.conn |> runResultAsync cfg.conn
|> ignore |> ignore
(tbl cfg Table.Post).IndexWait "webLogAndStatus" (tbl cfg Table.Post).IndexWait "webLogAndStatus"
|> runResultAsync cfg.conn |> runAtomAsync cfg.conn
|> ignore |> ignore
logStepDone () logStepDone ()
match idx.Contains "permalink" with match idx.Contains "permalink" with
@ -115,7 +115,7 @@ let checkPostIndexes cfg =
|> runResultAsync cfg.conn |> runResultAsync cfg.conn
|> ignore |> ignore
(tbl cfg Table.Post).IndexWait "permalink" (tbl cfg Table.Post).IndexWait "permalink"
|> runResultAsync cfg.conn |> runAtomAsync cfg.conn
|> ignore |> ignore
logStepDone () logStepDone ()
@ -129,7 +129,7 @@ let checkUserIndexes cfg =
|> runResultAsync cfg.conn |> runResultAsync cfg.conn
|> ignore |> ignore
(tbl cfg Table.User).IndexWait "logOn" (tbl cfg Table.User).IndexWait "logOn"
|> runResultAsync cfg.conn |> runAtomAsync cfg.conn
|> ignore |> ignore
logStepDone () logStepDone ()

View File

@ -8,6 +8,7 @@ open myWebLog.Entities
open Nancy open Nancy
open Nancy.Authentication.Forms open Nancy.Authentication.Forms
open Nancy.Bootstrapper open Nancy.Bootstrapper
open Nancy.Conventions
open Nancy.Cryptography open Nancy.Cryptography
open Nancy.Owin open Nancy.Owin
open Nancy.Security open Nancy.Security
@ -20,6 +21,7 @@ open RethinkDb.Driver.Net
open Suave open Suave
open Suave.Owin open Suave.Owin
open System open System
open System.IO
open System.Text.RegularExpressions open System.Text.RegularExpressions
/// Set up a database connection /// Set up a database connection
@ -68,6 +70,16 @@ type MyWebLogBootstrapper() =
container.Register<IUserMapper, MyWebLogUserMapper>() container.Register<IUserMapper, MyWebLogUserMapper>()
|> ignore |> ignore
override this.ConfigureConventions (conventions) =
base.ConfigureConventions conventions
// Make theme content available at [theme-name]/
Directory.EnumerateDirectories "views/themes"
|> Seq.iter (fun dir -> let contentDir = sprintf "views/themes/%s/content" dir
match Directory.Exists contentDir with
| true -> conventions.StaticContentsConventions.Add
(StaticContentConventionBuilder.AddDirectory (dir, contentDir))
| _ -> ())
override this.ApplicationStartup (container, pipelines) = override this.ApplicationStartup (container, pipelines) =
base.ApplicationStartup (container, pipelines) base.ApplicationStartup (container, pipelines)
// Data configuration (both config and the connection; Nancy modules just need the connection) // Data configuration (both config and the connection; Nancy modules just need the connection)

View File

@ -48,7 +48,9 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<None Include="App.config" /> <None Include="App.config" />
<None Include="data-config.json" /> <Content Include="data-config.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\myWebLog.Data\myWebLog.Data.fsproj"> <ProjectReference Include="..\myWebLog.Data\myWebLog.Data.fsproj">
@ -68,22 +70,54 @@
<ItemGroup> <ItemGroup>
<Content Include="content\scripts\tinymce-init.js" /> <Content Include="content\scripts\tinymce-init.js" />
<Content Include="content\styles\admin.css" /> <Content Include="content\styles\admin.css" />
<Content Include="views\admin\admin-layout.html" /> <Content Include="views\admin\admin-layout.html">
<Content Include="views\admin\category\edit.html" /> <CopyToOutputDirectory>Always</CopyToOutputDirectory>
<Content Include="views\admin\category\list.html" /> </Content>
<Content Include="views\admin\dashboard.html" /> <Content Include="views\admin\category\edit.html">
<Content Include="views\admin\page\edit.html" /> <CopyToOutputDirectory>Always</CopyToOutputDirectory>
<Content Include="views\admin\page\list.html" /> </Content>
<Content Include="views\admin\post\edit.html" /> <Content Include="views\admin\category\list.html">
<Content Include="views\admin\post\list.html" /> <CopyToOutputDirectory>Always</CopyToOutputDirectory>
<Content Include="views\admin\user\logon.html" /> </Content>
<Content Include="views\themes\default\index-content.html" /> <Content Include="views\admin\dashboard.html">
<Content Include="views\themes\default\index.html" /> <CopyToOutputDirectory>Always</CopyToOutputDirectory>
<Content Include="views\themes\default\layout.html" /> </Content>
<Content Include="views\themes\default\page-content.html" /> <Content Include="views\admin\page\edit.html">
<Content Include="views\themes\default\page.html" /> <CopyToOutputDirectory>Always</CopyToOutputDirectory>
<Content Include="views\themes\default\single-content.html" /> </Content>
<Content Include="views\themes\default\single.html" /> <Content Include="views\admin\page\list.html">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="views\admin\post\edit.html">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="views\admin\post\list.html">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="views\admin\user\logon.html">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="views\themes\default\index-content.html">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="views\themes\default\index.html">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="views\themes\default\layout.html">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="views\themes\default\page-content.html">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="views\themes\default\page.html">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="views\themes\default\single-content.html">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="views\themes\default\single.html">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup> </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. <!-- To modify your build process, add your task inside one of the targets below and uncomment it.