nikita-volkov / strelka

A simple, flexible and composable web-router
http://hackage.haskell.org/package/strelka
MIT License
85 stars 3 forks source link

How to run without a webserver? #2

Open seanhess opened 3 years ago

seanhess commented 3 years ago

Hi there, sorry if I'm being obtuse, but I can't see how to run a parser manually on some input.

For context, I'm trying to make an aws lambda function. They don't start a webserver, rather they are given the requested path as a Text or Bytestring. I would like to parse this path and have different execution branches depending on what matches.

I can't find a run function or equivalent in this package, and I can't figure out from context how I might accomplish this.

Any help is appreciated!

nikita-volkov commented 3 years ago

Hi. I don't think you need this library for your task then. Just split the path by slash using Text.split (=='/') and process it manually.