Skip to content

Instantly share code, notes, and snippets.

@machisuji
Forked from rkh/Scala
Created May 30, 2010 07:30
Show Gist options
  • Save machisuji/418858 to your computer and use it in GitHub Desktop.
Save machisuji/418858 to your computer and use it in GitHub Desktop.
require "sinatra"
get("/") { "Hello World!" }
use Dancer;
use Template;
get '/' => sub { template 'home' };
dance;
from itty import get, run_itty
@get('/')
def index(request):
return 'Hello World!'
run_itty()
require('express')
get('/user', function(){
"Hello World!"
})
(ns hello-world
(:use compojure.core
ring.adapter.jetty))
(defroutes main-routes
(GET "/" []
"Hello World")
(ANY "*" []
{:status 404, :body "<h1>Page not found</h1>"}))
(run-jetty main-routes {:port 8080})
require 'mercury'
module('hello', package.seeall, mercury.application)
get('/', function()
return "Hello world!"
end)
package main
import (
"web"
)
func hello(val string) string { return "Hello world!" }
func main() {
web.Get("/", hello)
web.Run("0.0.0.0:9999")
}
import wandledi.java.Controller;
public class WandlediApp extends Controller {
public void index() {
getWriter().println("Hello World!");
}
public static void main(String[] args) {
runStandAlone(true);
}
}
package com.thinkminimo.step
class StepExample extends Step {
get("/") { "Hello World!" }
}
@machisuji
Copy link
Author

Maybe it's a bit of a stretch to call Wandledi Sinatra-like.
But I just wanted to show how you can make a simple app with it
writing also not so many lines of code.

In Wandledi you actually can't simply map arbitrary URIs within a single controller.
For this you would first have to define a route mapping the different URIs to the
respective actions of the controller.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment