webapp-vim
What is this?
Web server that can write web application in Vim script.
Requirements
Install
You need to compile server. To comiple server, you need to install golang. After installing golang, type following.
$ cd ~/.vim/bundle
$ git clone https://github.com/mattn/webapp-vim
$ cd webapp-vim/server
$ go build webappvimd.go
$ ./webappvimd
Example application
This is application server. So this don't contains example to run webapp. Check webapp-foo-vim
How to register your webapp
You need to make following directory structure.
+---autoload
| |
| +--- myapp.vim ... add code for your application
|
+--- plugin ... script to register your application
|
+--- static ... static files
-
Add script to register your application in
plugin/myapp.vim
.call webapp#handle("/myapp", function('myapp#handle'))
-
Put html/js/css into
static
directory. -
Write application
function! myapp#handle(req) if a:req.path == '/foo' return {"body", "hello world"} else let a:req.path = a:req.path[4:] return webapp#servefile(a:req, s:basedir) endif endfunction
License
MIT
Author
Yasuhiro Matsumoto