This .NET solution uses the MySQLConnector in combination with the Dapper Object Mapping library to connect to and communicate to a MariaDB database instance.
This sample was created using the following techologies and they must be installed before proceeding.
First, open Todo.sln in Visual Studio.
Configure the MariaDB connection with your connection details in appsettings.json file.
Example implementation:
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
}
},
"ConnectionStrings": {
"TodoDatabase": "host=localhost;port=3306;user id=app_user;password=Password123!;database=todo;"
},
"AllowedHosts": "*"
}
Once you've pulled down the code and have verified built the project you're ready to run the application!
-
Build and run the application using Visual Studio. The solution will be built and the Web API project will begin listening on http://localhost:8080.
-
Within the terminal, navigate to the client folder and execute the following CLI command to start the React.js application.
$ npm install
$ npm start
- Open a browser window and navigate to http://localhost:3000 (which will load the TODO application web UI).