- Run npm init
- Configure the config.json file with your database details with your own mysql database.
- Remove the git repository from this project with rm -rf .git
- Initialize your own git repo with git init
- Connect your local git repo to your remote git repo with git remote add origin your-github-repo-ssh-key-goes-here
- Configure the package.json with your own information.
- Run the server with npm start or node server.js.
- Navigate to localhost:3000
- The public folder contains all public assets such as client side javascript files, css, and images.
- The controller folder contains all server side controllers and routes. Api and html routes and separated into separate files.
- home.js and testApi.js are files which contain functions which we will use as callbacks in our routes files.
- We have a partial folder in our views folder for any partial templates.
Our database is a global object. No need to require and export the the instance of our Sequelize connection (db). Access any of your models from anywhere in your project like so:
db.User.create({ name: username, password: password });
or
db.User.findOne({ where: { name: username, password: password } });