Ringojs is a JVM-based JavaScript platform that supports COMMONJS module mode
Installation
Download the package configuration environment variable, or use Docker to test using Docker
- Dockerfile
Deb Package Installation
FROM java:8MAINTAINER [email protected]RUN apt-get update && apt-get install -y jsvcADD ringojs_1.2.1_all.deb /tmp/ringojs.debRUN dpkg -i /tmp/ringojs.deb && rm /tmp/ringojs.debCMD ["bash"]
- Use
I built the base image Dalongrong/ringojs-docker
Dockerfile:FROM dalongrong/ringojs-dockerWORKDIR /appCOPY app.js /app/ENTRYPOINT [ "ringo","app.js" ]app.js:var app = function(request) {return {body: [‘Hello World‘],headers: {‘Content-Type‘: ‘text/html‘},status: 200}}var {Server} = require(‘ringo/httpserver‘);var server = new Server({app: app, port: 8080,host:"0.0.0.0"});server.start();docker-compose.yaml:version: "3"services: app: image: dalongrong/ringojs-app-demo build: ./ ports: - "8080:8080"
Run
docker-compose up -d
Access
Description
从使用还是比较简单的, 同时内置的模块已经够用常用的开发了,同时官方有集成spring 等框架的,类似vertx 比这个更加强大,生态相对来说比这个好很多
Resources
https://ringojs.org/
Https://github.com/rongfengliang/ringojs-docker
Ringojs JVM-based JavaScript platform trial