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

Update frontend to fetch() post data from the web server #263

Closed
humphd opened this issue Nov 17, 2019 · 3 comments
Closed

Update frontend to fetch() post data from the web server #263

humphd opened this issue Nov 17, 2019 · 3 comments
Assignees

Comments

@humphd
Copy link
Contributor

humphd commented Nov 17, 2019

In #262 we're adding routes to the web server to allow for getting data from the database, /posts (all post IDs in the database); and /post/<id> (get a particular post). In #261 we're updating the frontend code to make use of all the data in a post (see #259).

We also need to change the frontend code so that it uses fetch() to get post JSON data from the server, and "renders" it in our frontend.

For now, we can do this with jQuery or raw DOM API calls, and later we can move to some framework and components.

Keep the scope of this fix small: we need to get data from the web server, and use it to show posts in the page.

@lucacataldo
Copy link
Contributor

I'm going to work on this as more data gets exposed from the webserver (ie #262 gets done). In fact, I'm thinking of pairing these two together to try and speed things up if no one else claims 262 by the end of today.

@lucacataldo lucacataldo self-assigned this Nov 18, 2019
@humphd
Copy link
Contributor Author

humphd commented Nov 18, 2019

Awesome, thanks @lucacataldo. One thought for you and others, as we begin this: we can feed fake data into the pipeline at any point to help connect the system. What I mean is, don't get blocked on missing pieces (e.g., posts in Redis), just land code that returns fake data of the right format until we get real pieces in place to give good data. Make sense?

@lucacataldo
Copy link
Contributor

Yup makes sense! Thanks I'll try and get started then

lucacataldo added a commit to lucacataldo/telescope that referenced this issue Nov 25, 2019
Added the fetching of posts from frontend
Made small CSS changes to fix some rendered elements
Templated <article> tag for rendering
lucacataldo added a commit to lucacataldo/telescope that referenced this issue Nov 28, 2019
Review Changes 1
lucacataldo added a commit to lucacataldo/telescope that referenced this issue Nov 28, 2019
lucacataldo added a commit to lucacataldo/telescope that referenced this issue Nov 28, 2019
lucacataldo added a commit to lucacataldo/telescope that referenced this issue Nov 28, 2019
lucacataldo added a commit to lucacataldo/telescope that referenced this issue Dec 5, 2019
Picked work from humphd in Seneca-CDOT#426
Added support for limiting posts fetched
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants