Skip to content

Latest commit

 

History

History
45 lines (28 loc) · 2.69 KB

how-to-run-backend.md

File metadata and controls

45 lines (28 loc) · 2.69 KB

How to run backend

Step 1. Identify project dependencies.

Each .NET Core project should contain the file “settings.yaml” which is a setting template. Based on this file you can understand what external dependencies the current project has. First yaml node indicates the current project and it’s internal dependencies like database, cache or queue broker. Other nodes that usually contain “ServiceUrl”, “ServiceClient” are pointing to other services.

Step 2. Satisfy project dependencies.

Each .NET Core project should contain file “settings.json” which is a configuration file based on the “settings.yaml” template. You should modify this file locally (do not forget to add this file to .gitignore) and pass all setting values it requires which can be:

Step 3. Run the project.

Now when project settings are configured we are ready to run the project. In order for the project to run with local “settings.json” you need to point the project to this file using an environment variable called “SettingsUrl”.

Some projects require an additional environment variable called “ENV_INFO” which should contain any identification of you. This value is used when you are connecting to a development kubernetes cluster using VPN.

Step 4. Interact with a running project.

Each .NET Core project is HTTP API service. So it does not have a personal GUI to interact with. But you should be able to send requests to it and get responses using Swagger UI (general information about Swagger UI which is hosted on [http|https]://[yourhost]:[port]/swagger/ui.
For example, default service url will be: http://localhost:5000/swagger/ui/

Step 5. Entity Framework migrations

  1. Commands to intstall ef
dotnet --version
dotnet tool install --global dotnet-ef
dotnet ef
  1. Command to add migration
dotnet ef migrations add MigrationName --verbose

then to paste connection string, e.g. Server=(localdb)\\MSSQLLocalDB,1433;Database=openmavn;User Id=localdb;Password=localdb;