Skip to content

miladvafaeifard/todos-server

Repository files navigation

Server provided for todos

the application that works well with this server as backend, please check it: App

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes servicing for the client.

Prerequisites

  • Node version > 9
  • XAMPP or any alternative server that should be running mysql

Installing

  1. Import mini_tododb.sql to the sql server.

  2. Clone the server

git clone https://github.com/miladvafaeifard/todos-server
  1. install dependencies
cd vue-todo
npm install
  1. Start the application
npm run serve

docker node and mysql containers

build node

docker build -t myserver/todos-server .

run mysql

docker pull mysql:5.7
docker run  -d \
--name= mysql_db \
-p 3306:3306 \
-e MYSQL_ROOT_PASSWORD=root
mysql

run node

docker run  -d \
-p 5000:5000 \
-e PORT=5000 \
-e HOST='172.17.0.2' \
-e USER='root' \
-e PASS='root' \
--link mysql_db:db \
--name=todos-backend \
myserver/todos-server

Note: for this host '172.17.0.2' received from docker inspect mysql_db | grep IPAddress

docker compose

docker-compose build && docker-compose up -d

The semi-final step is to set mysql port to MYSQL_HOST in node.dockerfile file by looking up in the command line:

docker inspect <todos-server mysql ID> | grep IPAddress

and the final step is to rerun only the way:

docker build -f node.dockerfile -t todos-server_node .

Built With

  • Restify - The Restify framework used

Contributing

  1. Fork it!
  2. Create your feature branch: git checkout -b new-feature
  3. Commit your changes: git commit -am 'Add some message'
  4. Push to the branch: git push origin new-feature
  5. Submit a pull request :D

Authors

License

This project is licensed under the MIT License.

About

Server provided for todos

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published