Archives
Trending
Support
Login
clear text
XML
Django
JavaScript
MATLAB
C
C++
C#
Python
SQL
Shell
Bash
Markdown
YAML
JSON
HTML
CSS
PHP
Java
Ruby
Go
Rust
Swift
Kotlin
Arduino
TypeScript
Perl
Autohotkey
Lua
SQF
R
Scala
Haskell
Groovy
Dart
Clojure
VB.NET
Objective-C
PowerShell
Bash
CoffeeScript
Verilog
#!/usr/bin/env perl use Mojolicious::Lite; get '/' => sub { my ($c) = @_; my $hostHeader = $c->req->headers->host(); if ($hostHeader =~ /www.wethepeople.win(|:[0-9]{1,5})/) { $c->render() } else { $c->redirect_to('http://www.wethepeople.win') } } => 'index'; app->start(); # Testing with curl: # daniel@graymember:~/misc/mojo$ curl -I http://localhost:3000 -H 'Host: www.wethepeople.win' # HTTP/1.1 200 OK # Content-Length: 2709 # Date: Sat, 23 Jan 2021 00:47:54 GMT # Server: Mojolicious (Perl) # Content-Type: text/html;charset=UTF-8 # # daniel@graymember:~/misc/mojo$ curl -I http://localhost:3000 -H 'Host: www.wethepeople.win:3000' # HTTP/1.1 200 OK # Date: Sat, 23 Jan 2021 00:47:58 GMT # Content-Length: 2709 # Content-Type: text/html;charset=UTF-8 # Server: Mojolicious (Perl) # # daniel@graymember:~/misc/mojo$ curl -I http://localhost:3000 # HTTP/1.1 302 Found # Content-Length: 0 # Date: Sat, 23 Jan 2021 00:48:05 GMT # Location: http://www.wethepeople.win # Server: Mojolicious (Perl)
Mark as private (unlisted)
for 30 minutes
for 6 hours
for 1 day
for 1 week
for 1 month
for 1 year
everlasting (like CCCP)