Before inventing our own wheels, let's try out some others have built already. MEAN.io has a full stack already stubbed out with some stuff for us.
Get the Code
There are two ways to get the code. The first is presented by the "Download Now" button and gives you a zip file. The second is better.
The Zippy Way
- Click the button.
- In terminal, go to where you want the app to live. I've created a directory in home (~) called node_projects.
cd ~/node_projects - Move the .zip.
# mv can move and/or renamemv ~/Downloads/linnovate-mean-blah.zip ./ - Unzip and rename it.
# unzip is pretty straight forwardunzip ./linnovate-mean-blah.zip# mv can move and/or renamemv ./linnovate-mean-blah ./donkey
The Better Way (Clone the Repo)
- Clone the repo from Github.
# clone from the repogit clone https://github.com/linnovate/mean.git - Rename, because we'll probably do this again some day. Also, our project isn't called "mean."
# rename with mv - this seems familiarmv ./mean ./clean-mean - remove the old git info
# change to the new dircd ./clean-mean# remove the old .git dir so when we commit we don't have all the historyrm -rf ./.git - make it our own
- create repo in github (clean-mean)
# initialize git repogit init# include username when setting up remote so we don't have to provide it repeatedlygit remote add origin https://reergymerej@github.com/reergymerej/clean-mean.git# track all the filesgit add .# commitgit commit -m 'init commit'# after the initial push, "git push" will sufficegit push -u origin master
Start it Up
Whichever way you got the code, you'll have to start it up like this.
# install the dependencies with npm
npm install
# start it up with grunt on port 3000
grunt
No comments:
Post a Comment