Dear all,
I am calling a korn shell script(CGI script) by a web-page. This shell script do some checking in a unix file and return true or false. Now within the same script, If it returns true then I want to redirect to another web-page stored in htdocs directory.
Example: Login page sends a... (3 Replies)
Did a lot of searching on the net and found a lot of tricky ways and Vue.js libs to set meta tags, but I wanted sometime simpler.
So, given this standard HTML:
<head>
<title>Page Title</title>
<meta name="description" content="Page Description">
<meta name="keywords" content="Page... (0 Replies)
A shout out to Scott who gave me a helping hand to turn a simple sample Vue.js app I wrote yesterday into a Vue.js component:
Vue.component("unix-time", {
template: `<div class="time">{{unixtime}}</div>`,
data() {
return {
unixtime: ""
};
},
methods: {
... (1 Reply)
Recently, have been learning Vue and, as always, learning-by-doing, which means writing code for real-world applications. In this process, I have learned something that is not really mentioned in the majority of online Vue tutorials.
Basically, when you create a Vue instance in your browser,... (0 Replies)
Here is the query (and some sample results) I plan to use to build a new timeline page in the mockup vue.js usercp I am working on.
When the postid is the same as lastpostid, this means the timeline entry will be - "{{Member}} Started Discussion {{Thread Title}} at {{date and time}}" and when... (4 Replies)
A number of people have asked me how to get started with Vue.js and my reply before today was to Google "Vue.js". That has changed and my recommendation to anyone who wants to learn the fastest growing, easiest to learn and use Vue.js web dev framework is to watch this video tutorial series:
... (0 Replies)
This Vue.js chat component installed easily:
npm i --save vue-steam-chat
I was able to set it up and change the background color in the component css file to match the forums in seconds:
https://www.unix.com/members/1-albums225-picture1162.png
<template>
<div style="height: 600px;... (17 Replies)
Hello All,
After getting inspired from Neo, I have started a bit of JS learning these days. Whenever I learn something I will try to post it here(as of now my learning is NOT exactly bookish where I am going chapter by chapter etc, it could be more like small-small project vice kind of), I... (25 Replies)
Here is very good video from Evan You, founder of Vue.js, on the state of Vue.js
State of Vuenation with Evan You
Here is a nice PDF report on Vue.js
Update State of Vue.js Report
Vue.js is now the second most starred project on GitHub, recently surpassing Bootstrap.
These two... (0 Replies)
Sooner than later I will render forum discussions in Vue.js to complement the standard way of showing forum threads.
Today, I ran across this component, vue-code-highlight
Beautiful code syntax highlighting as Vue.js component.
https://www.unix.com/members/1-albums225-picture1199.jpg
... (1 Reply)
Discussion started by: Neo
1 Replies
LEARN ABOUT DEBIAN
router::simple::cookbook
Router::Simple::Cookbook(3pm) User Contributed Perl Documentation Router::Simple::Cookbook(3pm)NAME
Router::Simple::Cookbook - The Router::Simple Cookbook
FAQ
How to create Sinatra-ish framework with Router::Simple?
Please read the following example code.
package MySinatraish;
use Router::Simple;
use Plack::Request;
sub import {
my $pkg = caller(0);
my $router = Router::Simple->new();
my $any = sub ($$;$) {
my ($pattern, $dest, $opt) = do {
if (@_ == 3) {
my ($methods, $pattern, $code) = @_;
($pattern, {code => $code}, +{method => [ map { uc $_ } @$methods ]});
} else {
my ($pattern, $code) = @_;
($pattern, {code => $code}, +{});
}
};
$router->connect(
$pattern,
$dest,
$opt,
);
};
no strict 'refs';
# any [qw/get post delete/] => '/bye' => sub { ... };
# any '/bye' => sub { ... };
*{"${pkg}::any"} = $any;
*{"${pkg}::get"} = sub {
$any->([qw/GET HEAD/], $_[0], $_[1]);
};
*{"${pkg}::post"} = sub {
$any->([qw/POST/], $_[0], $_[1]);
};
*{"${pkg}::as_psgi_app"} = sub {
return sub {
if (my $p = $router->match($_[0])) {
[200, [], [$p->{code}->()]];
} else {
[404, [], ['not found']];
}
}
};
}
package MyApp;
use MySinatraish;
get '/' => sub {
'top';
};
post '/new' => sub {
'posted';
};
as_psgi_app;
How to switch from HTTPx::Dispatcher?
HTTPx::Dispatcher is class specific declararative router.
package MyApp::Dispatcher;
use HTTPx::Dspatcher;
connect '/', {controller => 'foo', action => 'bar'};
1;
The following script is same as above.
package MyApp::Dispatcher;
use Router::Simple::Declare;
my $router = router {
connect '/', {controller => 'foo', action => 'bar'};
};
sub match { $router->match() }
How to use Router::Simple with non-strictly-MVC application?
use Router::Simple::Declare;
my $router = router {
connect '/foo/bar/' => { 'target' => '/foobar.asp' };
connect '/topics/:topic' => { target => '/my-topic.asp' };
connect '/products/{Category:.*}' => { target => '/products.asp', Category => 'All' };
connect '/zipcode/{zip:[0-9]{5,5}}' => {target => '/zipcode.asp' };
};
You can pass the target path as destination.
AUTHOR
Tokuhiro Matsuno <tokuhirom AAJKLFJEF GMAIL COM>
LICENSE
Copyright (C) Tokuhiro Matsuno
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
SEE ALSO
Router::Simple
perl v5.14.2 2011-05-15 Router::Simple::Cookbook(3pm)