copenhagenjs.dk
copenhagenjs.dk copied to clipboard
Question: Hard-coded absolute paths and dev instance
I can get the site running locally using the basic information from the README.
$ npm run dev
But the source is scattered with hard-coded absolute paths, I have tried to change them, but the changes are not reflected in the running instance.
Do you need to rebuild the contents or the GraphQL instance?
Okay, I hacked my fork to replace the hard-coded domain names in links with localhost, so I can run on localhost solely.
This is by no means a good approach since the it manipulates with the data from the GraphQL, unless the GraphQL is regarded as a general service - is it :-)
Anyway do you want a PR from my branch (localhost_ftw) it would just be for inspection, based on my above comment.
Great issue open, I knew it wasn't a great experience.
Okay two things 😄
In graphql like the github graphql api links are absolute because the link to resources, this so you could build thirdparty apps and still link to the correct issues. So in theory it is correct that it goes to copenhagenjs.dk even in development. But in reality it would be nice if it stayed in localhost for ease of testing.
Second, I would really encourage development with Storybook as that removes the need for any API interaction and for really smooth and fast front-end development.
Regarding the graphql instance, yes everything has finally been refactored to work fetching from graphql.
Running a instance can be done by $ bazel run //runs/graphql:run
What we can do: I could see we could have a function that takes a link and then sees if it is in development and then converts it from absolute to relative 😄