Serendipia is a simple RESTful (Representational State Transfer) gateway service for the purpose of discovery, load balancing and failover.
$ serendipia
// Express example
import express from 'express'
import axios from 'axios';
// ... [code]
app.listen(0, function () {
const port = this.address().port
const register = () => axios.post('http://127.0.0.1:3000/services', {
service_name: "example_service",
service_port: port.toString()
});
// Register microservice
register()
// Update microservice
setInterval(register, 4000)
console.log(`Server run: http://localhost:${port}/`)
})
[SerendipiaServer]/[MicroServiceName]/[MicroServicePath]
- Version support