Example of how to build an API based on ASP.NET Core
- Java 8
- MySQL 5.7.15
- Flyway Command-line
- ASP.NET Core
To execute SQL Scripts, it was used Flyway
The properties and its default values are the following:
flyway.driver=com.mysql.jdbc.Driver
flyway.url=jdbc:mysql://127.0.0.1:3306
flyway.user=root
flyway.password=r00t
flyway.schemas=example
flyway.locations=filesystem:../Sql
flyway.encoding=UTF-8
flyway.baselineOnMigrate=true
Note. The above properties can be overwritten. To overwrite just go to Migrations/Configuration/flyway.conf
and change the properties with the values that you want.
$ cd Migrations/Commands/
$ sh migrate.sh
In the file appsettings.json
set your own database connection configuration under the tag DatabaseConfiguration
On the main directory where is located the project.json
follow the nexts steps:
- To build
$ dotnet build
- To run
$ dotnet run
- Finally, test it here!!