Giter Club home page Giter Club logo

inertia-go's People

Contributors

petaki avatar tom-on-the-internet avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

inertia-go's Issues

Does this do SSR

Does using this allow for SSR of javascript front-end applications with go backend?

How to use petaki/inertia with Golang Fiber?

I've installed petaki/inertia using go get github.com/petaki/inertia-go and tried to follow the documentation,
but I'm not sure how to proceed with the Fiber integration.
Can you please help me out a bit

content type is "text/plain; charset=utf8"

Apologies in advance if this is not related to the inertia-go module, which is great.

This module does not set the content-type to "text/html". I believe it relies on Go's behaviour of reading the first number of bytes and determining the content type based on that.

Locally this works fine for me and I get content-type "text/html; charset=utf8". But when I run this in an AWS Lambda function, the content type is "text/plain; charset=utf8". The browser then does not render the html.

As a workround, I've wrapped the Render method.

func (s *Server) renderInertia(w http.ResponseWriter, r *http.Request, component string, props map[string]interface{}) error {
	w.Header().Set("Content-Type", "text/html; charset=utf-8")

	return s.inertiaManager.Render(w, r, component, props)
}

This works because the content-type is overwritten for JSON responses, but this solution feels pretty bad.

Do you have any insight into why "text/plain; charset=utf8" is being set as the content-type?
Would it make sense to explicitly set the content-type in this module if no x-inertia header exists?

Thanks for your time!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.