Code Monkey home page Code Monkey logo

Comments (8)

bscott avatar bscott commented on September 26, 2024

@darron Thanks for willing to contribute, Which troubles are you having with Buffalo?

from golangflow.

markbates avatar markbates commented on September 26, 2024

@darron https://github.com/bscott/golangflow/blob/master/actions/home.go#L47 shows usage of the app host. You can also get the host from the request.

from golangflow.

markbates avatar markbates commented on September 26, 2024

In theory appending the host here https://github.com/bscott/golangflow/blob/master/actions/home.go#L63 should it.

from golangflow.

darron avatar darron commented on September 26, 2024

from golangflow.

markbates avatar markbates commented on September 26, 2024

@darron I'm curious as to how you're trying to print stuff out.

This worked for me:

	c.Logger().Debugf("host: %s", App().Host)
time="2017-07-11T09:48:06-04:00" level=debug msg="host: http://127.0.0.1:3000" method=GET params="{}" path="/rss" request_id=98e632ee05-c05154116e 

Also fmt.Printf works for me too.

How are you trying to log stuff?

Also, I updated the code with the following:

Link:  &feeds.Link{Href: fmt.Sprintf("%s/posts/%s", App().Host, p.ID)},

And it worked no problem.

    <item>
      <title>Post 2</title>
      <link>http://127.0.0.1:3000/posts/c68c8f7c-fe30-48a1-a331-f4f7b33d7d8a</link>
      <description>content for 2</description>
      <author>DB Seed</author>
      <pubDate>Tue, 11 Jul 2017 09:50:47 +0000</pubDate>
    </item>

How are you trying to build the link?

from golangflow.

darron avatar darron commented on September 26, 2024

I was doing it pretty much the exact same way.

I thought that maybe there was some old/duplicate versions of software around - so I blew away all my old buffalo binaries, pulled this repo again and started from scratch:

export GOPATH="/Users/dfroese/go"
cd ~/go/src/github.com/bscott
[email protected]:bscott/golangflow.git
cd golangflow
go get -u -v github.com/gobuffalo/buffalo/buffalo
dep ensure
npm install
buffalo dev

This is the only change:

Link:        &feeds.Link{Href: fmt.Sprintf("%s/posts/%s", App().Host, p.ID)},

Now it totally works like it should - no more missing / in the <link>.

Thanks for the tip about c.Logger() - wasn't aware that was available.

I am not sure what happened there - but now it all seems to work.

Sorry for the false alarm / bug report - appreciate the help sorting it out.

from golangflow.

markbates avatar markbates commented on September 26, 2024

No worries. Not sure what the mismatch was, but glad you got it working. :)

from golangflow.

bscott avatar bscott commented on September 26, 2024

Fixed and merged. Thanks @darron

from golangflow.

Related Issues (20)

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.