API Fundamentals, authentication, encryption, and persistence
git clone https://github.com/rudolphh/express-product-api.git
cd express-product-api
npm install
Create a .env file in the root directory of the project with the following
PORT=3033
DB_PORT=3306
DB_HOST=localhost
DB_USER=root
DB_PASS=root
DB_NAME=express_rudazon
TOKEN_EXPIRES_IN=30m
REFRESH_TOKEN_EXPIRES_IN=60m
SECRET_KEY=somekindofsecrettext
These can be adjusted to your preference, including DB_NAME, the name of the database schema the seeder will use to automatically create some initial data for you in the database.
Make sure to have MySQL installed for your OS.
Use the link above for instructions, or if you have Docker use the docker-compose.yml file in the root folder.
In the project root, just run the command:
docker-compose up -d
npm start
Verify the deployment by navigating to your server address localhost:3033/hello in your favorite browser
If you don't have Postman, or Insomnia, or don't care to use those, there is a test.rest file in the root directory.
This uses the Rest Client extension within VSCode for simple API testing
Technology | Description |
---|---|
node.js | Evented I/O for the backend |
Express | Fast node.js network app framework @tjholowaychuk |
jsonwebtoken | An implementation of JSON Web Tokens |
bcrypt | A library to help you hash passwords. |
mysql2 | MySQL client for Node.js with focus on performance |
dotenv | Loads environment variables from .env file |
Want to contribute? Great!
MIT
Free Software, Heaven Yeah!