module(Hello, {
Get("/", [](Context){
return "Hello world!";
});
});module(Static, {
Get("/", [](Context) {
return StaticResponse("index.html");
});
});int main() {
frankie::run(9090);
return 0;
}module(Hello, {
Get("/", [](Context){
return "Hello world!";
});
});module(Static, {
Get("/", [](Context) {
return StaticResponse("index.html");
});
});int main() {
frankie::run(9090);
return 0;
}$ sudo nano /etc/lightdm/lightdm.conf # add the following lines to the [SeatDefaults] section # don't sleep the screen xserver-command=X -s 0 dpms
$ sudo nano /etc/xdg/lxsession/LXDE/autostart # comment everything and add the following lines @xset s off @xset -dpms @xset s noblank @midorifrom http://www.niteoweb.com/blog/raspberry-pi-boot-to-browser Unclutter To hide the mouse pointer when it's not used install unclutter, sudo apt-get install unclutter Script to autostart rails on startup
#! /bin/sh
### BEGIN INIT INFO
# Provides: rails
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start a Rails instance
# Description: Do the simplest thing possible in keeping with
# upstart to spin up a single Rails instance.
### END INIT INFO
# Author: Sam Pointer & Fredrik Leijon
#
# Do NOT "set -e"
PATH=/sbin:/usr/sbin:/bin:/usr/bin:/home/pi/.rvm/bin
USER="pi"
PORT=3000
RAILS_ROOT="/home/pi/path_to_app"
COMMAND="rails s -d"
DESCRIPTION="Rails instance"
RVM_PROFILE="/home/pi/.rvm/environments/default"
# Load the VERBOSE setting and other rcS variables
. /lib/init/vars.sh
# Define LSB log_* functions.
# Depend on lsb-base (>= 3.0-6) to ensure that this file is present.
. /lib/lsb/init-functions
#
# Function that starts the daemon/service
#
do_start()
{
# Return
# 0 if daemon has been started
# 1 if daemon was already running
# 2 if daemon could not be started
su -c "source $RVM_PROFILE && cd $RAILS_ROOT && $COMMAND" $USER
}
case "$1" in
start)
[ "$VERBOSE" != no ] && log_daemon_msg "Starting $DESCRIPTION"
do_start
case "$?" in
0|1) [ "$VERBOSE" != no ] && log_end_msg 0 ;;
2) [ "$VERBOSE" != no ] && log_end_msg 1 ;;
esac
;;
esac
from http://blog.sam-pointer.com/2011/03/24/starting-a-rails-instance-automatically-on-boot-on-ubuntu-server.html, slightly modified to support rvm. Script is also available here as a gist.
public class AppInit
{
private static IWindsorContainer _container;
public static void AppInitialize()
{
_container = new WindsorContainer();
_container.AddFacility();
_container.Register(Component.For().ImplementedBy());
}
}
The last thing to do is in the Serivce.svc markup add the castle factory attribute: Factory="Castle.Facilities.WcfIntegration.DefaultServiceHostFactory, Castle.Facilities.WcfIntegration".
<add name="dotless" path="*.less" verb="GET" type="dotless.Core.LessCssHttpHandler,dotless.Core" resourceType="Unspecified" preCondition="" /><dotless minifyCss="false" cache="true" web="false" source="dotless.Core.Input.VirtualFileReader" />