Last active
October 14, 2016 10:48
-
-
Save kana-sama/d39d6b9ebb59e72e297002829cae9824 to your computer and use it in GitHub Desktop.
hello-worlds bakends on different stacks
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
(ns hello-world.core | |
(:require [compojure.core :refer [defroutes GET]])) | |
(defroutes app | |
(GET "/hello/:name" [name] | |
(str "Hello " name "!"))) |
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
package main | |
import ( | |
"fmt" | |
"github.com/go-martini/martini" | |
) | |
func main() { | |
m := martini.Classic() | |
m.Get("/hello/:name", func(params martini.Params) string { | |
return fmt.Sprintf("Hello %s!", params["name"]) | |
}) | |
m.Run() | |
} |
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
const express = require('express') | |
const app = express() | |
app.get('/hello/:name', (req, res) => { | |
res.send(`Hello ${ req.params.name }!`) | |
}) | |
app.listen() |
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
<?php | |
// На самом деле это лишь один из файлов, laravel распалагается | |
// в большом количестве файлов и папок, не очень он мне уже нравится | |
Route::get('/hello/{name}', function ($name) { | |
return 'Hello '.$name.'!'; | |
}); |
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
from flask import Flask | |
app = Flask(__name__) | |
@app.route('/hello/<name>') | |
def hello(name): | |
return 'Hello %s!' % name |
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
require "sinatra" | |
get "hello/:name" do |name| | |
"Hello #{ name }!" | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment