Node, Express and Postgres (using Sequelize and ElasticSearch)
$ NODE_ENV=aws-dev npm run db:init
$ NODE_ENV=aws-dev npm start
If you dont have install node-js, please go this link https://nodejs.org
I am installing on the Mac. So type the following command in your terminal to install Elasticsearch via homebrew.
brew install elasticsearch
It will install it and now start the services using the following command.
brew services start elasticsearch
sudo add-apt-repository "deb https://apt.postgresql.org/pub/repos/apt/ trusty-pgdg main"
sudo apt-get update
sudo apt-get install postgresql-9.6
ubuntu@:~$ sudo passwd postgres
Enter new UNIX password:****
Retype new UNIX password:****
passwd: password updated successfully
sudo service postgresql start
ubuntu@:~$ su postgres
Password:****
createdb database_name
psql -d database_name
{
"development": {
"username": "you_DATABASE_username",
"password": "you_DATABASE_password",
"database": "you_DATABASE_name",
"host": "127.0.0.1",
"port": 5432,
"dialect": "postgres"
},
}
npm install
for install dependicesnpm run start:dev
sequelize db:migrate
sequelize db
all
.
.
.
$ NODE_ENV=aws-dev npm run db:init
$ NODE_ENV=aws-dev npm start
$ sudo docker build -t getcontact .
$ sudo docker run -e getcontact .
Have fun! smile