Closed rhgksrua closed 8 years ago
Reordered package.json
. It should be more readable now.
This should not be merged. Its using static files to serve index.html, but we really shouldn't do this. Express has much better way of serving webpages.
html directory has been moved out from public directory. This will make more sense when we use templates for a more complex project.
any DB added?
@sorinr not needed yet. We're going to display data from external API calls first. Maybe after that, we'll start storing our own data.
@rhgksrua One more question. Why is server.js placed in the root? Is that required? Can this be configured somewhere? Would be cleaner if that was placed in the private directory, perhaps. (just a suggestion)
server.js
can be anywhere except public directory. But right now, we barely have anything server side. We can move it around if server side gets more complicated.
@rhgksrua I would suggest to use nodemon for development and add one more script to package.json "dev": "nodemon server.js"
. So we can run npm run dev
on development machine and need not restart server manually whenever server side code changes
@vinaypuppal Good point. But maybe we should do that in a separate issue. I have seen alot of wrong indentations, so maybe we can create an issue where we implement the nodemon module and a JavaScript linter module, all within the same issue, sounds cool?
I've fixed all indentation to 2 spaces and added npm start
as another option to start the server. I'll leave out nodemon
for now. I've read the chat and we'll figure out if we'll use nodemon
or some kind of live reloading. @vinaypuppal, can you create an issue for that?
You have my approval, @rhgksrua
@rhgksrua done created a new issue #6
Added basic node server using Express web framework.
running
node server.js
ornpm start
should start the server. Just remember to runnpm install
before running it.resources/
directory contains js and css for client.server.js
servesindex.html
.