This repository contains the web server for a card game made in Unity. The server is built using Node.js and Express.js, and it utilizes the dotenv library for environment variable management. The core functionalities for handling database operations are encapsulated in the database.js
file, which is then utilized by the app.js
file for various route handlers.
- Node.js
- Express.js
- dotenv
- Clone the repository:
git clone https://github.com/your-username/webServer.git
cd webServer
Install dependencies:
npm i
Rename the .env-template
to .env
. Add the required environment variables, for example:
DB_HOST=localhost
DB_USER=username
DB_PASSWORD=password
DB_DATABASE=cardgame_db
Usage To start the web server, run:
npm start
This will launch the server on the specified port (default is 3000). You can access the API at http://localhost:3000 or the configured port.
- app.js: Main file containing route handlers and server setup.
- database.js: File with functions for handling database operations.
Ensure that you have a MySQL database set up with the credentials specified in your .env file.