xtool/contrib/mORMot/SQLite3/Samples/22 - JavaScript HTTPApi web...
Razor12911 098e8c48de source upload 2022-01-17 22:16:47 +02:00
..
JSHttpApiServer.dpr source upload 2022-01-17 22:16:47 +02:00
mustache.md source upload 2022-01-17 22:16:47 +02:00
readme.md source upload 2022-01-17 22:16:47 +02:00
showDownRunner.js source upload 2022-01-17 22:16:47 +02:00
showdown.js source upload 2022-01-17 22:16:47 +02:00

readme.md

SpiderMonkey execution sample

Point your browser to http://localhost:888/root/readme.md and see the Markdown template rendered using SpiderMonkey.

This is not a production HTTP server, just a sample of SpiderMonkey usage within mORMot.

Features shown:

  • TSMEngineManager for thread-safe engine creation;
  • Add external JavaScript libs to engine (showdown.js - javascript port of the Markdown library);
  • Add native function to engine (loadFile);
  • Garbage collection management.

Take a look at the following methods:

procedure TTestServer.DoOnNewEngine(const Engine: TSMEngine);
function TTestServer.Process(Ctxt: THttpServerRequest): cardinal; (last lines)