-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.fs
More file actions
38 lines (31 loc) · 763 Bytes
/
Copy pathProgram.fs
File metadata and controls
38 lines (31 loc) · 763 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
// Learn more about F# at http://fsharp.org
open System
open Suave
open Suave.Filters
open Suave.Operators
open Suave.Successful
open PdfUtils
let app =
choose
[ GET >=> choose
[
path "/" >=> OK "Index"
pathScan "/api/text/%s" getFileText
]
POST >=> choose
[
path "/api/text" >=> extractText
]
]
let initApp() =
createAppDirs()
processExistingPdfFiles()
[<EntryPoint>]
let main argv =
initApp()
let newConfig =
{ defaultConfig with
bindings = [ HttpBinding.createSimple HTTP "127.0.0.1" 8085 ]
}
startWebServer newConfig app
0