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 rename
mv ~/Downloads/linnovate-mean-blah.zip ./
- Unzip and rename it.
# unzip is pretty straight forward
unzip ./linnovate-mean-blah.zip
# mv can move and/or rename
mv ./linnovate-mean-blah ./donkey
The Better Way (Clone the Repo)
- Clone the repo from Github.
# clone from the repo
git 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 familiar
mv ./mean ./clean-mean
- remove the old git info
# change to the new dir
cd ./clean-mean
# remove the old .git dir so when we commit we don't have all the history
rm -rf ./.git
- make it our own
- create repo in github (clean-mean)
# initialize git repo
git init
# include username when setting up remote so we don't have to provide it repeatedly
git remote add origin https://reergymerej@github.com/reergymerej/clean-mean.git
# track all the files
git add .
# commit
git commit -m 'init commit'
# after the initial push, "git push" will suffice
git 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