DanyDin1801 / Product-Portal

0 stars 2 forks source link

added basic node server #4

Closed rhgksrua closed 8 years ago

rhgksrua commented 8 years ago

Added basic node server using Express web framework.

running node server.js or npm start should start the server. Just remember to run npm install before running it.

resources/ directory contains js and css for client. server.js serves index.html.

rhgksrua commented 8 years ago

Reordered package.json. It should be more readable now.

rhgksrua commented 8 years ago

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.

rhgksrua commented 8 years ago

html directory has been moved out from public directory. This will make more sense when we use templates for a more complex project.

sorinr commented 8 years ago

any DB added?

JordyVlassembrouck commented 8 years ago

@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.

JordyVlassembrouck commented 8 years ago

@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)

rhgksrua commented 8 years ago

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.

vinaypuppal commented 8 years ago

@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

JordyVlassembrouck commented 8 years ago

@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?

rhgksrua commented 8 years ago

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?

JordyVlassembrouck commented 8 years ago

You have my approval, @rhgksrua

vinaypuppal commented 8 years ago

@rhgksrua done created a new issue #6