Please signup on the heroku and signin on it and create new node app.
It is mean stack project. So it needs mongodb. It is using mlab as a remote mongodb.
If you create your own mlab account, you should change the remote mongodb url on backend/lib/conf.ts
line 2
You can also change other envrionment variables (for example: mail password
, mail username
so on) on this file.
You can use google captcha with your own site_key.
In that case you need to change the code in backend and frontend.
You can find the variables on the environment.ts for frontend src/enviroment/environment(prod).ts
.
You can find the vairables on the conf.ts for backend. lib/conf.ts
.
Please npm install
for both of angular(frontend) and node(backend).
And please input ng serve
in the root directory of frontend and npm run dev
in the root directory of backend.
And navigate your browser and input following url http://localhost:4200
.
That's all
Angular project should be built first.
The command is like this(on the directory of the angular project). npm install
ng build --prod
.
After that, the compiled source will be automatically nested on the pubilc directory of the node server.
This node server was made by Type script(.ts
).
So in order to deploy it to the Heroku, It should be compiled.
The command is like this (on the directory of the node project). npm install
npm run build
.
After that, It will be compiled and make the dist
directory on the root directory of node server.
(It can be run on localhost:8080 locally)
Please install Heroku CLI and GIT on your PC.
And Please input following commands (on your local) to deploy the node sever into your heroku.
git init
heroku create
git add .
git commit -m 'your commit'
git push heroku master
heroku ps:scale web=1
heroku open
5.1.1 Please copy the Item Directory (frontend/src/app/views/item
) of emet-meanstack repo and paste it current Item Directory
You can change it just like (frontend/src/app/views/sessions/signin/signin.component.ts
99 ~ 101 line) of emet-meanstack repo
...
if (res.role === 1) { // admin
this.router.navigate(['/user/list']);
} else { // user
this.router.navigate(['/item/list']);
}
##5.2 Node Part