Skip to content
This repository has been archived by the owner on Nov 8, 2021. It is now read-only.

boechat107/websharper_samples

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WebSharper Samples

This repository contains simple WebSharper projects, written in F#, prepared to run on Linux with Mono.

Motivation

Interested to know about the applicability of WebSharper for real projects and coming from the Linux world (I never used .NET before), I tried to run some experiments but I got frustrated with the available tools and documentation for just "getting started" (look at this question).

In summary, the main motivation for this repository is to help people to get started with F# and WebSharper.

Requirements

Supposing you are running on a Debian/Ubuntu environment:

  • mono-devel
  • mono-runtime
  • fsharp

Editor

To run this project, you don't need to use any specific editor, but VS Code integrates well with F# (no surprises) and has some useful plugins (like Vim keybindings and Ionide).

vim-sharp seems full of features too, but I found it too heavy for a common Vim experience.

Usage

  1. Fetch paket.exe by running mono .paket/paket.bootstrapper.exe.

  2. Download and install the dependencies with mono .paket/paket.exe install.

  3. Compile the code:

cd wsnextui/WsNextui 
xbuild
  1. Exectute the self-hosted web server:
cd bin
mono WsNextui.exe
  1. Check the following URL with your browser: http://localhost:9000

Known Caveats

  • Projects created with Ionide seem to generate .fsproj with wrong paths (look at those with ..\packages\...).
  • There are some issues about running Client-Server Web Application as .NET module 1 with xsp4 (Mono's web server for development or testing).
  • The file Web.config is a little tricky. For WsNextui, Web.config should be present in the source code directory for the compilation step in order to have the compiled JS (F# to JS) files, even if this file is empty (look at this question).

[1]: These kind of projects don't generate .exe files, but only .dll files.

Contributions

PRs and "issues" are more than welcome! :-)

About

Small WebSharper projects to run on Linux

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published