mattR
is a bare bones web framework that aims to give you complete control
over your app.
At the moment mattR
doesn't concern itself with models so you could say it is
a View-Tempate (MV) framework.
Install mattR
from GitHub using
devtools, load
the package and create a skeleton for your app.
devtools::install_github("bobjansen/mattR")
library(mattR)
skeleton()
After creating the app using skeleton()
you need to create routes and views
for your app.
Application routes must be defined in routes.R
as a list of vectors named
routes
as follows
routes <- list(
c("^/todo$", genericView(todo)),
c("^/admin$", templateView(admin)),
c("^/login$", genericView(login)),
c("^/.*$", staticView(file.path(getwd(), "static/"), "/"))
)
where the *
View functions are defined by mattR
.
The first element of the list is used to match the path of the url and the second element is (after evaluation) a function that takes returns the response.
Optionally, a file init.R
can be defined which runs when mattR
is started
to setup the application. By convention, the result of source()
'-ing this
file is put in a list appState
which will be attach()
ed to the search path.
Example application can be found in mattR_examples.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.