poga / actix-lua

Safe Lua Scripting Environment for Actix
MIT License
121 stars 13 forks source link

Actix web demo #2

Closed naturallymitchell closed 6 years ago

naturallymitchell commented 6 years ago

Would you please make a Lua webserver demo?

poga commented 6 years ago

I've added an example about using actix-lua with actix-web at https://github.com/poga/actix-lua/tree/master/examples/http-server

Feel free to ask if you have any question.

naturallymitchell commented 6 years ago

Could (external) Lua scripts control resources and routes, not just the Rust code compiled to them that call Lua?

poga commented 6 years ago

Sure. There are two way to achieve it off top of my head:

First, you can write a catch all route in actix-web and do routing and handling all inside the lua actor.

Or you can parse routing config written in lua and generate an actix-web application based on the config.