├── .deployment ├── Procfile ├── paket.dependencies ├── .paket └── paket.bootstrapper.exe ├── paket.lock ├── README.md ├── app.json ├── app.heroku.fsx ├── app.azure.fsx ├── web.config ├── app.fsx └── .gitignore /.deployment: -------------------------------------------------------------------------------- 1 | [config] 2 | command = build.cmd deploy -------------------------------------------------------------------------------- /Procfile: -------------------------------------------------------------------------------- 1 | web: fsharpi-heroku --define:START_SERVER app.heroku.fsx 2 | -------------------------------------------------------------------------------- /paket.dependencies: -------------------------------------------------------------------------------- 1 | source https://nuget.org/api/v2 2 | 3 | nuget FAKE 4 | nuget Suave 5 | nuget FSharp.Compiler.Service 6 | -------------------------------------------------------------------------------- /.paket/paket.bootstrapper.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tpetricek/suave-xplat-gettingstarted/HEAD/.paket/paket.bootstrapper.exe -------------------------------------------------------------------------------- /paket.lock: -------------------------------------------------------------------------------- 1 | NUGET 2 | remote: https://nuget.org/api/v2 3 | specs: 4 | FAKE (3.29.2) 5 | FSharp.Compiler.Service (0.0.89) 6 | FSharp.Core (3.1.2.1) 7 | FsPickler (1.0.19) 8 | Suave (0.26.2) 9 | FSharp.Core (>= 3.1.2.1) 10 | FsPickler (>= 1.0.7) 11 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Suave.io on Azure and Heroku 2 | 3 | [![Deploy to Azure](http://azuredeploy.net/deploybutton.png)](https://azuredeploy.net/) 4 | [![Deploy to Heroku](https://www.herokucdn.com/deploy/button.png)](https://heroku.com/deploy) 5 | 6 | This site is based on [suavebootstrapper](https://github.com/shanselman/suavebootstrapper) by 7 | [@shanselman](http://github.com/shanselman). It is a minimalistic sample that shows how to 8 | create Suave repository that can be hosted on both Azure and Heroku. 9 | -------------------------------------------------------------------------------- /app.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Suave.io demo application", 3 | "description": "Simple Suave.io web app with easy Heroku and Azure deployment", 4 | "website": "http://suave.io/", 5 | "repository": "https://github.com/tpetricek/suave-xplat-gettingstarted", 6 | "logo": "https://raw.githubusercontent.com/SuaveIO/suave/gh-pages/images/logo.gif", 7 | "keywords": [ "suave", "fsharp" ], 8 | "env": { 9 | "BUILDPACK_URL": "https://github.com/SuaveIO/mono-script-buildpack.git" 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /app.heroku.fsx: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------- 2 | // Start the 'app' WebPart defined in 'app.fsx' on Heroku using %PORT% 3 | // -------------------------------------------------------------------------------------- 4 | 5 | #load "app.fsx" 6 | open App 7 | open System 8 | open Suave 9 | 10 | let serverConfig = 11 | let port = int (Environment.GetEnvironmentVariable("PORT")) 12 | { Web.defaultConfig with 13 | homeFolder = Some __SOURCE_DIRECTORY__ 14 | logger = Logging.Loggers.saneDefaultsFor Logging.LogLevel.Warn 15 | bindings = [ Types.HttpBinding.mk' Types.HTTP "0.0.0.0" port ] } 16 | 17 | Web.startWebServer serverConfig app -------------------------------------------------------------------------------- /app.azure.fsx: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------- 2 | // Start the 'app' WebPart defined in 'app.fsx' on Azure using %HTTP_PLATFORM_PORT% 3 | // -------------------------------------------------------------------------------------- 4 | 5 | #r "packages/FAKE/tools/FakeLib.dll" 6 | #load "app.fsx" 7 | open App 8 | open Fake 9 | open System 10 | open Suave 11 | 12 | let serverConfig = 13 | let port = int (getBuildParam "port") 14 | { Web.defaultConfig with 15 | homeFolder = Some __SOURCE_DIRECTORY__ 16 | logger = Logging.Loggers.saneDefaultsFor Logging.LogLevel.Warn 17 | bindings = [ Types.HttpBinding.mk' Types.HTTP "127.0.0.1" port ] } 18 | 19 | Web.startWebServer serverConfig app 20 | -------------------------------------------------------------------------------- /web.config: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /app.fsx: -------------------------------------------------------------------------------- 1 | // -------------------------------------------------------------------------------------- 2 | // Minimal Suave.io server! 3 | // -------------------------------------------------------------------------------------- 4 | 5 | #r "packages/Suave/lib/net40/Suave.dll" 6 | open Suave 7 | open Suave.Web 8 | open Suave.Types 9 | open Suave.Http.Successful 10 | 11 | let app : WebPart = OK("

minimalism

") 12 | 13 | // If you prefer to run things manually in F# Interactive (over running 'build' in 14 | // command line), then you can use the following commands to start the server 15 | #if TESTING 16 | // Starts the server on http://localhost:8083 17 | let config = { defaultConfig with homeFolder = Some __SOURCE_DIRECTORY__ } 18 | let _, server = startWebServerAsync config app 19 | let cts = new System.Threading.CancellationTokenSource() 20 | Async.Start(server, cts.Token) 21 | // Kill the server (so that you can restart it) 22 | cts.Cancel() 23 | #endif -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .vscode/ 2 | .vscode/* 3 | !.vscode/settings.json 4 | !.vscode/tasks.json 5 | !.vscode/launch.json 6 | !.vscode/extensions.json 7 | 8 | ## Ignore Visual Studio temporary files, build results, and 9 | ## files generated by popular Visual Studio add-ons. 10 | 11 | # User-specific files 12 | *.suo 13 | *.user 14 | *.sln.docstates 15 | *.sln.ide/ 16 | 17 | # Xamarin Studio / monodevelop user-specific 18 | *.userprefs 19 | 20 | # Build results 21 | 22 | [Dd]ebug/ 23 | [Rr]elease/ 24 | x64/ 25 | build/ 26 | [Bb]in/ 27 | [Oo]bj/ 28 | 29 | # Enable "build/" folder in the NuGet Packages folder since NuGet packages use it for MSBuild targets 30 | !packages/*/build/ 31 | 32 | # MSTest test Results 33 | [Tt]est[Rr]esult*/ 34 | [Bb]uild[Ll]og.* 35 | 36 | *_i.c 37 | *_p.c 38 | *.ilk 39 | *.meta 40 | *.obj 41 | *.pch 42 | *.pdb 43 | *.pgc 44 | *.pgd 45 | *.rsp 46 | *.sbr 47 | *.tlb 48 | *.tli 49 | *.tlh 50 | *.tmp 51 | *.tmp_proj 52 | *.log 53 | *.vspscc 54 | *.vssscc 55 | .builds 56 | *.pidb 57 | *.log 58 | *.scc 59 | 60 | # Visual C++ cache files 61 | ipch/ 62 | *.aps 63 | *.ncb 64 | *.opensdf 65 | *.sdf 66 | *.cachefile 67 | 68 | # Visual Studio profiler 69 | *.psess 70 | *.vsp 71 | *.vspx 72 | 73 | # Guidance Automation Toolkit 74 | *.gpState 75 | 76 | # ReSharper is a .NET coding add-in 77 | _ReSharper*/ 78 | *.[Rr]e[Ss]harper 79 | 80 | # TeamCity is a build add-in 81 | _TeamCity* 82 | 83 | # DotCover is a Code Coverage Tool 84 | *.dotCover 85 | 86 | # NCrunch 87 | *.ncrunch* 88 | .*crunch*.local.xml 89 | _NCrunch_* 90 | 91 | # Installshield output folder 92 | [Ee]xpress/ 93 | 94 | # DocProject is a documentation generator add-in 95 | DocProject/buildhelp/ 96 | DocProject/Help/*.HxT 97 | DocProject/Help/*.HxC 98 | DocProject/Help/*.hhc 99 | DocProject/Help/*.hhk 100 | DocProject/Help/*.hhp 101 | DocProject/Help/Html2 102 | DocProject/Help/html 103 | 104 | # Click-Once directory 105 | publish/ 106 | 107 | # Publish Web Output 108 | *.Publish.xml 109 | 110 | # Windows Azure Build Output 111 | csx 112 | *.build.csdef 113 | 114 | # Windows Store app package directory 115 | AppPackages/ 116 | 117 | # Others 118 | sql/ 119 | *.Cache 120 | ClientBin/ 121 | [Ss]tyle[Cc]op.* 122 | ~$* 123 | *~ 124 | *.dbmdl 125 | *.[Pp]ublish.xml 126 | *.pfx 127 | *.publishsettings 128 | 129 | # RIA/Silverlight projects 130 | Generated_Code/ 131 | 132 | # Backup & report files from converting an old project file to a newer 133 | # Visual Studio version. Backup files are not needed, because we have git ;-) 134 | _UpgradeReport_Files/ 135 | Backup*/ 136 | UpgradeLog*.XML 137 | UpgradeLog*.htm 138 | 139 | # SQL Server files 140 | App_Data/*.mdf 141 | App_Data/*.ldf 142 | 143 | 144 | #LightSwitch generated files 145 | GeneratedArtifacts/ 146 | _Pvt_Extensions/ 147 | ModelManifest.xml 148 | 149 | # ========================= 150 | # Windows detritus 151 | # ========================= 152 | 153 | # Windows image file caches 154 | Thumbs.db 155 | ehthumbs.db 156 | 157 | # Folder config file 158 | Desktop.ini 159 | 160 | # Recycle Bin used on file shares 161 | $RECYCLE.BIN/ 162 | 163 | # Mac desktop service store files 164 | .DS_Store 165 | 166 | # =================================================== 167 | # Exclude F# project specific directories and files 168 | # =================================================== 169 | 170 | # NuGet Packages Directory 171 | packages/ 172 | 173 | # Generated documentation folder 174 | docs/output/ 175 | 176 | # Temp folder used for publishing docs 177 | temp/ 178 | 179 | # Test results produced by build 180 | TestResults.xml 181 | 182 | # Nuget outputs 183 | release.cmd 184 | release.sh 185 | localpackages/ 186 | paket-files 187 | *.orig 188 | .paket/paket.exe 189 | docs/content/license.md 190 | docs/content/release-notes.md 191 | _NCrunch_Paket 192 | docs/content/paket-*.md 193 | *.bak --------------------------------------------------------------------------------