Suneido

Integrated Application Platform

  • Home
  • Learning
    • Suneido Manual
    • Beginners
      • Inside Suneido
      • The Suneido Programming Language
      • The Suneido Database
      • Installing Suneido
      • Building Suneido
      • IDE Go To Tour
      • Upgrading To A New Release
    • Advanced
      • Canvas Control
      • DrawControl Part 1
      • DrawControl Part 2
      • DrawControl Part 3
      • SAX Like XML Processing
      • A Plug-In Architecture
      • A Simple Wizard Framework
      • An HTML Include Facility
      • An RSS 2 Feed Creator
      • MIME Generation
      • A New Add-on Facility
      • Workspace Improvement Hack
    • Mockito for Suneido
    • The Suneido Task Scheduler
    • Contributing To Suneido
    • Contributor Assignment of Copyright
    • Language Translation
    • Future Directions
    • Interview With Andrew Mckinlay
  • Forum
    • Announcements
    • Internals & Enhancements
    • Cookbook
    • General
  • FAQ
  • Screenshots
  • Downloads
  • Links

Reply To: Razor

Integrated Application Platform › Forums › General › Razor › Reply To: Razor

August 13, 2019 at 1:41 pm #1477
hao_xie
Participant

Here is a simple Rack server listing all the database table names

class
	{
	CallClass(port = 80)
		{
		RackServer(app: RackRouter(.routes()), with: [RackLog], :port)
		}
	routes()
		{
		return [['GET', '/tables$', .tables]]
		}
	tables(env/*unused*/)
		{
		content = QueryList("tables", 'tablename')
		return Razor(.template, [:content])
		}
	template: '
<html>
	<head lang="en"><meta charset="UTF-8"></head>
	<body>
		<h1>Tables</h1>
		@for(line in .content)
			{
			<div>@line</div>
			}
	</body>
</html>'
	}

To start the server, you just need to call the class name of this code in workspace. After launching the server, you can visit “http://127.0.0.1/tables&#8221; to see the page.

Search Forums

Log In
Welcome to the new Suneido Web Site and Forum.
Register
Lost Password
users of the previous PHPBB Forum should be able to log in with their previous username and password.

Recent Topics

  • how to start jsuneido ?
  • Problem Starting Suneido…
  • Dialog not showing buttons
  • New link for Suneidojo
  • Excel

Contact Us | Legal Statement | Privacy Statement | SiteMap

(c) Suneido Software Corporation - Open Source Integrated Database and Programming Language