Lazarus
Home
Forum
Help
TinyPortal
Search
Login
Register
Lazarus
»
Programming
»
Networking and Web Programming
»
RESTful API Server
Free Pascal
Website
Downloads
Wiki
Bugtracker
Mailing List
Lazarus
Website
Downloads (Laz+FPC)
FAQ
Wiki
Bugtracker
Packages
IRC channel
Developer Blog
Follow us on Twitter
Latest SVN
Mailing List
Other languages
Foundation
Website
Useful Wiki Links
Project Roadmap
Getting the Source
Screenshots
About donations (wiki)
Bookstore
Computer Math and Games in Pascal
Search
Advanced search
« previous
next »
Print
Pages: [
1
]
Author
Topic: RESTful API Server (Read 2295 times)
Blestan
Sr. Member
Posts: 457
RESTful API Server
«
on:
May 12, 2017, 12:08:41 am »
Hi! i just uploaded a very very early version of my rest api server on github
https://github.com/blestan/UltraMachine
the server is multithreaded and requests are handled in a pool of threads - half permanents half spwned on demand.
the server is indended to run behind a loadbalancing reverse proxy with ssl termination ( HA Proxy or Digital Ocean loadbalancers) thats why any ssl stuff is stripped!!!
this backend i focused on serving heavy load JSON for real world mobile apps with frontends build with ionic or react native.
the flow is the following when a request arrives the backend finds the application object that will handle it then the app returns a handler object for the path requested and the object handles the request ... then the thread goes to sleep over RTLEvent and does not consume any cpu
the idea is to use as many static memory as possible to avoid getmems/freemems and memory fragmentation. even the threads are not TThread class ... everywhere where possible pools of preallocated records are used. ofcourse my own json parser (fpc-xon) is heavely used
) .. i will add hashes to fpc-xon in several days for serving in memory json object db.. node replication is planed
any comments are welcome
and dont forget - this is not a production ready backend yet!!!
P.S: The name UltraMachine is a tribute to my favourite band Depeche Mode
))
«
Last Edit: May 12, 2017, 12:16:42 am by Blestan
»
Logged
Speak postscript or die!
Translate to pdf and live!
nomorelogic
Full Member
Posts: 110
Re: RESTful API Server
«
Reply #1 on:
May 19, 2017, 07:24:53 pm »
hi
perhaps missing the test.lpr file?
thanks
Logged
Blestan
Sr. Member
Posts: 457
Re: RESTful API Server
«
Reply #2 on:
May 20, 2017, 12:45:42 am »
the backend test project is named TestMachine.lpr
you need also to download the fpc-xon package from my github account because ultramachine is based on fpc-xon ...
you need a program like postman or apc ( chrome app) to send queries to the api server
( please not that for the moment this is under heavy developpment and its not functional yet - i'm testing all the parts like threads sockets http parsing etc ..)
«
Last Edit: May 20, 2017, 12:52:26 am by Blestan
»
Logged
Speak postscript or die!
Translate to pdf and live!
lainz
Hero Member
Posts: 2490
I'm coding :)
Re: RESTful API Server
«
Reply #3 on:
March 09, 2018, 12:31:31 am »
Hi, know it's an old thread, but what is the status now?
Last commit July 15 2017 (for your two projects).
And then seems that there are no more contributions to this..
Logged
https://lainz.github.io/
Print
Pages: [
1
]
« previous
next »
Lazarus
»
Programming
»
Networking and Web Programming
»
RESTful API Server
Recent
Following code crashes ap...
by
WooBean
[
Today
at 01:15:53 pm]
Insert check mark symbol
by
exdatis
[
Today
at 01:09:41 pm]
Blogs
by
Handoko
[
Today
at 12:54:57 pm]
Go on with Lazarus for da...
by
edwinyzh
[
Today
at 12:09:23 pm]
macOS 32-bit app warning
by
Hansaplast
[
Today
at 11:03:51 am]
[Solved] tachart format t...
by
wp
[
Today
at 10:58:21 am]
Lazarus Mediaplayer with ...
by
somby
[
Today
at 10:48:09 am]
Inconsistent behaviour of...
by
han
[
Today
at 10:47:40 am]
prefix change on classnam...
by
YoupMelon
[
Today
at 10:04:49 am]
Find text
by
justnewbie
[
Today
at 09:41:22 am]