|
1 year ago | |
---|---|---|
.. | ||
src | 1 year ago | |
README.md | 1 year ago | |
benchmark_config.json | 1 year ago | |
config.toml | 1 year ago | |
elide.dockerfile | 1 year ago |
Elide is a runtime which can execute JavaScript, Ruby, Python, and others, all in one package.
Elide is powered by GraalVM, which enables polyglot software design. Code units can interoperate from any supported language.
The test script embedded for this benchmark uses Elide's built-in HTTP intrinsic from JavaScript:
// access the built-in HTTP server engine
const app = Elide.http;
// register basic handler
app.router.handle("GET", "/plaintext", (request, response) => {
// respond using the captured path variables
response.send(200, "Hello, world!");
});
// register a route handler
app.router.handle("GET", "/json", (request, response, context) => {
// respond using the captured path variables
response.send(200, JSON.stringify({ message: "Hello, world!" }));
});
// configure the server binding options
app.config.port = 3000;
// receive a callback when the server starts
app.config.onBind(() => {
console.log(`Server listening at "http://localhost:${app.config.port}"! 🚀`);
});
// start the server
app.start();
http://localhost:3000/json
http://localhost:3000/plaintext