Skip to content

bcopy/revealjs-microservice

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

85 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GraalVM Native Image builds reveal.js

Reveal.js microservice

This microservice provides a native, self-standing executable to serve Reveal.js presentations over HTTP.

How to use it

  1. Simply download the executable for your given platform (Linux, Windows, Mac OSX are supported).
  2. Create a www folder to contain your presentation
  3. Create a resources folder to contain your binary and static resources (images, reveal.js plugins etc...)
  4. Create an index.html file in www to host your reveal.js presentation (Bonus : you can use Thymeleaf templating)
  5. Note that all reveal.js resources are available under /webjars/reveal.js/, for instance :
    • /webjars/reveal.js/dist/reveal.js
    • /webjars/reveal.js/plugin/notes/notes.js
    • /webjars/reveal.js/dist/reset.css
  6. Start the server with executing reveal-microservice and it will be available at http://localhost:8080/index.html

Under the hood

This microservice is implemented using Spring Boot 3 and its amazing native image compilation support. As such, you can configure the microservice using any of the supported Spring Boot application properties.

All presentation templates are also Thymeleaf templates, which supports the injection of request parameters and other dynamic properties into your presentations.

One custom property available to you is the location of your reveal.js presentation (by default ./www/), you can override this by adding a parameter to the microservice execution (for instance if your files are stored in ./my-custom-folder) :

reveal-microservice --spring.thymeleaf.prefix=file:./my-custom-folder/

Please note that the path must end with a forward slash.

Static resources (e.g. images) are served from the folder ./resources/, you can also adjust this location like so :

reveal-microservice --spring.web.resources.static-locations=./my-other-resource-location/

How to develop

Pre-requisites

  • Java 17 GraalVM 23.0+ (normally ships with the native component out of the box)

Building the Spring Boot application

Using the provided Maven wrapper, simply call :

./mvnw package

You can then run the service with :

./mvnw spring-boot:run

You can compile a Native image with :

./mvnw -q -B native:compile -Pnative

For more details on how to compile the native image, please refer to HELP.md.

Releasing a new version

To release a new version, invoke the gitflow plugin like so :

./mvnw gitflow:release

It will prompt for the new version number, and increment all related Maven information, before pushing all updates.

About

A native microservice that serves Reveal.js presentations

Topics

Resources

Stars

Watchers

Forks

Languages