This is a Node.js + Express backend for managing patients with epilepsy. It provides endpoints to register users, fetch user profiles, and retrieve predefined categories.
api-express/
├── app.js # Main Express application
├── .env # Environment variables (not committed)
├── data/ # Static JSON files
│ └── categories.json
├── config/nginx/ # Example Nginx configuration
│ └── default.conf
├── package.json
└── README.md
git clone https://github.com/NolanBeaujault/cortest-api.git
cd cortest-apinpm installCreate a .env file at the root of the project with the following content:
DB_HOST=localhost
DB_USER=root
DB_PASSWORD=your_mysql_password
DB_NAME=epilepsie
DB_PORT=3306
node app.jsThe API will now be running on http://localhost:2880.
POST /register– Register a new userGET /profil/:uid– Get profile info of a userGET /categories– Get available categories (static JSON)
See config/nginx/default.conf for an example configuration that proxies requests to the API.
-
Ensure your MySQL database and table
utilisateursare properly created before starting the server. You can use the provided.sqlfile to create theutilisateurstable:mysql -u root -p < create_table_utilisateurs.sql -
Never commit your
.envfile or any sensitive credentials to the repository. -
You can find the detailed documentation of this application in the Cortest Documentation Repository.