aardio 文档

aardio 范例: Hello World / PHP_CGI 服务器

//Ruby/CGI服务器
import win.ui;
/*DSG{{*/
var winform = win.form(text="Hello World / PHP_CGI 服务器";right=759;bottom=469)
winform.add()
/*}}*/

//Ruby 语法速览 https://quickref.me/zh-CN/docs/ruby.html
var code = /*
require 'cgi'

cgi = CGI.new
puts cgi.header
puts "<html><body>This is a test</body></html>"
*/
string.save("/index.rb",code);

import process.ruby.simpleHttpServer;
var url = process.ruby.simpleHttpServer.startUrl("/index.rb");

import web.form;
var wb = web.form(winform);

wb.go(url);
winform.show();

win.loopMessage();

Markdown 格式