Created
March 29, 2020 00:31
-
-
Save mthadley/a92d508501890ac9e57df7277874d794 to your computer and use it in GitHub Desktop.
Portable Nix/Ruby Web Server
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env nix-shell | |
#! nix-shell -i ruby -p ruby bundler --pure | |
#! nix-shell -I nixpkgs=https://github.com/NixOS/nixpkgs/archive/nixos-20.03.tar.gz | |
require "bundler/inline" | |
gemfile do | |
source "https://rubygems.org" | |
gem 'sinatra' | |
gem 'thin' | |
gem 'haml' | |
end | |
get '/' do | |
haml :index | |
end | |
Sinatra::Application.run! | |
__END__ | |
@@ index | |
%h1 | |
Hello World | |
@@ layout | |
%html | |
%head | |
%title= "My app" | |
%body | |
= yield |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment