Skip to content

Files

Latest commit

bb44d87 · Aug 26, 2021

History

History

WebSample

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
Aug 19, 2021
Aug 15, 2021
Jul 26, 2021
Aug 19, 2021
Jul 26, 2021
Aug 15, 2021
Aug 26, 2021
Aug 26, 2021
Jul 27, 2021
Aug 4, 2021
Jul 26, 2021

WebSample

This is the server-side .NET 5.0 ASP .NET Core example project for the Flutter version of NETCoreSync. This server-side example works in conjunction with its client-side example here. Read more about the Flutter version of NETCoreSync in the netcoresync_moor's README.

Getting Started

  • Ensure the Microsoft .NET 5.0 SDK is installed.
  • This example uses the PostgreSQL database. Ensure that it is installed and its service is running correctly.
  • Clone this project to your local machine: git clone https://github.com/aldycool/NETCoreSync.git.
  • This example uses the Entity Framework Core to communicate with the PostgreSQL. Navigate to the NETCoreSync/Samples/ServerTimeStamp/WebSample folder, and the connection string for the PostgreSQL is hardcoded inside the Startup.cs's ConfigureServices() method like the following:
    services.AddDbContext<DatabaseContext>(options =>
    {
        options.UseNpgsql("Host=localhost;Database=NETCoreSyncServerTimeStampDB;Username=NETCoreSyncServerTimeStamp_User;Password=NETCoreSyncServerTimeStamp_Password");
    });
    You may change the hardcoded connection string to your PostgreSQL database, or, if you want to follow the hardcoded settings, create a PostgreSQL database called NETCoreSyncServerTimeStampDB, and create a PostgreSQL Login Role called NETCoreSyncServerTimeStamp_User and its password is set to NETCoreSyncServerTimeStamp_Password. Make sure that the Login Role has Login privileges and allowed to access the database. Please consult the PostgreSQL documentation on how to configure these requirements.
  • Navigate to the WebSample folder and run the app:
    cd NETCoreSync/Samples/ServerTimeStamp/WebSample
    dotnet restore
    dotnet run
  • After the server has launched, you can use web browser to view its UI interface in the listening URL from the dotnet run output (such as: https://localhost:5001).
  • At this point, the server is ready to receive client synchronization requests. Now you can try its client-side synchronization in the client example here.

For more details on the client-side and server-side configuration, read the Flutter version of NETCoreSync in the netcoresync_moor's README.