• Stars
    star
    21
  • Rank 1,084,038 (Top 22 %)
  • Language
    Racket
  • License
    MIT License
  • Created over 5 years ago
  • Updated about 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Routy is a lightweight high performance HTTP request router for Racket

MIT licensed Scribble Docs

Routy

HTTP router for Racket

Routy is a lightweight high performance HTTP request router for Racket.
It uses the same routing syntax as used by popular Ruby web frameworks like Ruby on Rails and Sinatra.

Documentation

Documentation

Usage

(require routy)
(require web-server/servlet)
(require response-ext)

(routy/get "/blog/:name/page/:page" ; eg. "/blog/racket/page/2"
  (lambda (req params)
    (format "blog:~a page:~a" (request/param params 'name) (request/param params 'page))))

(routy/post ...) ; POST request
(routy/put ...) ; PUT request
(routy/delete ...) ; DELETE request
(routy/patch ...) ; PATCH request

;start server
(serve/servlet
    (λ (req) (routy/response req)) ; routy response
    #:launch-browser? #f
    #:servlet-path "/"
    #:port 8000
    #:servlet-regexp #rx"")

with wildcards:

(routy/get "/blog/some*/page/:page" ; eg. "/blog/some-racket/page/2"
  (lambda (req params) 
    (format "page:~a" (request/param params 'page))))

(routy/get "/blog/*/page/:page" ; eg. "/blog/anyname/page/2" 
  (lambda (req params) 
    (format "page:~a" (request/param params 'page))))

(routy/get "/blog/**/page/:page" ; eg. "/blog/racket/super/buper/page/2"
  (lambda (req params) 
    (format "page:~a" (request/param params 'page))))

not found 404 page:

(routy/not-found 
  (lambda (req) 
    "OOPS.. CANNOT FIND THIS PAGE"))

(routy/not-found 
  "OOPS.. CANNOT FIND THIS PAGE")

(routy/not-found 
  (lambda (req)
    (response/make #:code 200 "SOME TEXT")))

serve files:

(routy/files "/plain-docs" #:root "/var/www/my-site") ; eg. "/plain-docs/boring-doc.html"

with params constraints:

(routy/get "/blog/:name/page/:page" #:constraints '((name #px"\\w+") (page #px"\\d+")) ; eg. "/blog/racket/page/2", but not "/blog/10/page/two"
  (lambda (req params) 
    (format "blog:~a page:~a" (request/param params 'name) (request/param params 'page))))

More Repositories

1

mictray

MicTray is a Lightweight system tray application which lets you control the microphone state and volume
Vala
37
star
2

awesome-stumpwm

A curated list of high-quality docs/modules/configs for StumpWM
29
star
3

purple-xmpp-http-upload

HTTP File Upload plugin for libpurple (XMPP Protocol)
C
26
star
4

nuke.xplr

xplr file viewer and opener
Lua
11
star
5

zsh-archlinux

ZSH Arch Linux plugin
Shell
10
star
6

stumpwm-rofi

Rofi module for StumpWM
Common Lisp
6
star
7

davesync

Synchonizes and encrypts a local directory with a remote WebDAV folder
Python
4
star
8

h02own

The H02Own is a TCP Server Owntracks gateway for H02 protocol devices.
Go
4
star
9

YamlConfigurationServiceProvider

Fast YAML Configuration Service Provider for Silex
PHP
4
star
10

cctv-watcher

Application for CCTV cameras monitoring.
Vala
4
star
11

PHP-MTCNN

Implementation of the MTCNN face detector for PHP
PHP
3
star
12

phone-number-validator

PhoneNumber validation component for Symfony based frameworks (Symfony, Silex, Drupal etc.)
PHP
3
star
13

stumpwm-pamixer

Minimalistic Pulseaudio volume and microphone control module for StumpWM.
Common Lisp
3
star
14

gvolwheel

GVolWheel is a Lightweight application which lets you control the audio volume.
C
3
star
15

JSendResponse

JSendResponse Component for HttpFoundation based frameworks (Symfony, Silex, Drupal etc.)
PHP
3
star
16

stumpwm-notifier

StumpWM module for sending desktop notifications
Common Lisp
2
star
17

YamlRouteServiceProvider

Silex Service provider for using YAML routing files
PHP
2
star
18

smtp-ses-proxy

SMTP server that convert SMTP message to AWS SES API Call
Go
2
star
19

zsh-ohmyfzf

ZSH fzf pllugin
Shell
2
star
20

HandlerSocketServiceProvider

HandlerSocket Service Provider for Silex
PHP
2
star
21

angular-admob-free

AngularJS module for Cordova Admob Free Plugin
2
star
22

HSAL

HandlerSocket Abstraction Layer for PHP
PHP
2
star
23

stumpwm-config

My configuration files for StumpWM
Common Lisp
2
star
24

recaptcha-enterprise

reCAPTCHA Enterprise system for Common Lisp
Common Lisp
2
star
25

php-debugbar-smarty

Smarty Collector for PHP DebugBar
PHP
2
star
26

HybridAuthServiceProvider

Silex HybridAuth Service Provider
PHP
2
star
27

ua-parser

User Agent Parser for Common Lisp
Common Lisp
2
star
28

hashids

Common Lisp system to generate YouTube-like hashes from one or many numbers
Common Lisp
2
star
29

stumpwm-wpctl

PipeWire (WirePlumber) volume and microphone control module for StumpWM
Common Lisp
2
star
30

chicken-mosquitto

Chicken Scheme bindings to the libmosquitto MQTT client library
Scheme
2
star
31

paren-async

async/await extension for Parenscript
Common Lisp
2
star
32

paren-jquery

Parenscript macros for jQuery
Common Lisp
2
star
33

geonames

GeoNames API Client for Common Lisp
Common Lisp
2
star
34

opencv-jit

OpenCV 4.x bindings for Common Lisp
Common Lisp
2
star
35

gapi

Google API client for Common Lisp.
Common Lisp
2
star
36

SilexJsend

JSend Component for Silex
PHP
1
star
37

InfluxDbServiceProvider

InfluxDb Service Provider for Silex
PHP
1
star
38

flycheck-php-noverify

Flycheck checker for PHP using Noverify linter
Emacs Lisp
1
star
39

FacebookCanvasServiceProvider

Facebook Canvas Service Provider for Silex
PHP
1
star
40

consult-slime

Consult commands for SLIME
Emacs Lisp
1
star
41

HTTP-DAV-Nginx

Perl Client library for Nginx WebDAV server
Perl
1
star
42

google-translate

Free Google Translate API for Common Lisp
Common Lisp
1
star
43

FacebookServiceProvider

Facebook SDK v5 Service Provider for Silex
PHP
1
star
44

ModelServiceProvider

Model Service Provider for Silex
PHP
1
star
45

cordova-plugin-admob-mediation-adcolony

Cordova AdMob Mediation Plugin for AdColony
1
star
46

cordova-plugin-admob-mopub

Cordova AdMob Mediation Plugin for MoPub
1
star
47

ionic-multirange

Ionic v1 multi range component
JavaScript
1
star
48

dinero

Home Finance program
C
1
star
49

random-ua

Random User-Agent generator for Common Lisp
Common Lisp
1
star
50

cordova-plugin-admob-mediation-pangle

Cordova AdMob Mediation Plugin for Pangle
1
star
51

describe-hash

Emacs describe-hash function
Emacs Lisp
1
star
52

stumpwm-screenshot-maim

Screenshot module for StumpWM
Common Lisp
1
star
53

stumpwm-window-switch

Windows switch module for StumpWM
Common Lisp
1
star
54

stumpwm-kbdd

Per window XKB layout switcher and modeline module for StumpWM.
Common Lisp
1
star
55

stumpwm-acpi-backlight

ACPI backlight control module for StumpWM
Common Lisp
1
star
56

gresolver

DNS client (resolver) for Common Lisp
Common Lisp
1
star
57

fcm

Common Lisp Client for FCM - Firebase Cloud Messaging
Common Lisp
1
star
58

angular-inapppurchase

AngularJS module for Cordova Inapppurchase Plugin
1
star
59

shortener-list

PHP Library for detect shorteners domains
PHP
1
star
60

OneSignalServiceProvider

OneSignal Service Provider for Silex
PHP
1
star
61

GoogleApiServiceProvider

Google API Service Provider for Silex
PHP
1
star
62

stumpwm-nuclear

Nuclear music player module for StumpWM
Common Lisp
1
star
63

ControllerServiceProvider

Controller Service Provider for Silex
PHP
1
star
64

SmartyTrait

Silex Smarty Trait
PHP
1
star
65

response-ext

Extended HTTP response functions for Racket Web Server
Racket
1
star
66

Image-Info-XS

Perl module for extracting various kind of meta information from image files.
XS
1
star
67

racket-route-match

URL route-matching library for Racket
Racket
1
star
68

gnotify

Common Lisp system to send desktop notifications
Common Lisp
1
star
69

stumpwm-battery

Battery information module for StumpWM
Common Lisp
1
star
70

rssgen

RSS 2.0 generator for Common Lisp
Common Lisp
1
star
71

mobiledetect

Common Lisp system for detecting mobile devices (including tablets) in User-Agent strings
Common Lisp
1
star
72

stumpwm-tomato

Advanced Pomodoro timer module for StumpWM
Common Lisp
1
star
73

easy-aes

Common Lisp system for OpenSSL compatible AES encryption
Common Lisp
1
star
74

extracond

Extra set of conditional macros for Common Lisp
Common Lisp
1
star
75

admob-ssv

Google Admob server-side verification system for Common Lisp
Common Lisp
1
star