#Structuring Sinatra Web Application Scaffold
Starting from here to create your own web applications, or you want to learn how to wirte a sinatra module based app by example
##Folder structure for Arowana:
##Precondition:
- bundle install
- check how to start the postgresql service in c9.io
- set
username
/pwd
aspostgres
/root
if you use my default settings - create sinatra_web DB
postgres=# create database "sinatra_web";
- create "user" table in postgresql DB
CREATE TABLE "user" (
id serial Primary key NOT NULL,
username varchar(50) NOT NULL,
pwd varchar(50) NOT NULL,
permission varchar(10) NOT NULL
);
- insert one record into user table
INSERT INTO "user" (username, pwd, permission) VALUES ('admin', 'admin', 'rw');
- more psql commands, refer to docs
##How to run
$ rackup config.ru -p $PORT -o $IP
$ rackup config.ru
##Thanks To
Sinatra Framework
Structuring Sinatra Applications
Structuring Sinatra Apps
c9.io