My first time posting here and I am completely new to web development so I apologise in advance if there is something similar on here already (I have had a good search)!
In short, I am making an app that fetches images from Instagram based on the users search input. Pretty easy. However, I am using Node and Express server side and React client side and I have googled many React tutorials, Express tutorials and I am confused as to how to even get started. Each tutorial uses different dependancies (which I have tried to Google and understand what they do) and are not explicit sometime as to where to put the code - I have seen app.js, server. js, templates.jsx. Hopefully, someone can explain in layman terms that helps us newbies.
So basically, I'd like some idea of how to set up my app and what files I will need e.g. app.js contains this code, server.js contains this code etc so that at least something shows up on my page.
So far I have this:
// in my app.js
var express = require('express'),
app = express();
app.use(express.static('public'));
app.get('/hashtag/:hashtag', function(req, res) {
var token = (removed);
// this is where id fetch instagram imgs
});
var server = app.listen(3000, function () {
var host = server.address().address;
var port = server.address().port;
console.log('Instagallery server listening on http://%s:%s', host, port);
});
Thank you very much for any help/information!
Late to the party, but this tutorial provides an overview of setting up React with Express and may be useful for others experiencing similar frustrations.
https://medium.com/front-end-developers/handcrafting-an-isomorphic-redux-application-with-love-40ada4468af4#.yjzuy2k97
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With