Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Http support #280

Open
jamesalbert opened this issue Jun 17, 2019 · 6 comments
Open

Http support #280

jamesalbert opened this issue Jun 17, 2019 · 6 comments

Comments

@jamesalbert
Copy link

jamesalbert commented Jun 17, 2019

I'm not sure if http support is better implemented built-in or through a library, but it's a generally useful feature.

I took a stab at handling get requests (super ugly, just got an mvp going)

jamesalbert@2695e5b

Are there already plans to implement something like this? If not, with some feedback, is this something that can be added to the project?

@IngwiePhoenix
Copy link
Contributor

There was someone planning to work on passing features from a single-header socket library to Gravity.

Fortunately, making a wrapper for a library towards Gravity is not that difficult - but it does involve reading through the various headers, since not all functions are labeled very well (take the marry_* functions and macros for instance, which do array handling).

But for that, you do get a very low-level access to Gravity and values, reducing the layers of abstractions quite some and making access to the wrapper itself quite fast.

I was looking into Swig, but trying to write a wrapper generator using Swig is all but easy unfortunately...

@jamesalbert
Copy link
Author

@IngwiePhoenix is there a wrapper on github I can use for reference? I tried looking, but gravitational spams the search + it seems there are still open issues for module support

@IngwiePhoenix
Copy link
Contributor

https://github.com/marcobambini/gravity/blob/master/src/optionals/gravity_env.c
https://github.com/marcobambini/gravity/blob/master/src/optionals/gravity_env.h

This is one that I contributed. In general, you can find some good examples within the optionals folder.

@jamesalbert
Copy link
Author

Oh, I saw those. That's what I modeled my changes off of

@IngwiePhoenix
Copy link
Contributor

And yes - module support is in fact still missing. But with module support, people mean something like this:

import x from "y";
var x = require("y");

But you can still add functions to Gravity just fine.

@jamesalbert
Copy link
Author

jamesalbert commented Jun 17, 2019

think my link was poorly placed, fixed it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants