Sunday, 5 April 2026

Setup Data API Builder (DAB)

 1. Create a .env file and paste these lines inside it:

conn ="Server=localhost,1433;
          User ID=<UserName>;
          Password='<Password>';
          Database=<DB_Name>;
          TrustServerCertificate=True;
          Encrypt=True;"

ASPNETCORE_URLS=http://<Server>:<Port>

2. Initialize DAB - this will create 

dab init --database-type "mssql" --host-mode "Development" --connection-string "@env('conn')"

3. Add entity to the DAB dab-config.json

dab add <Name> --source dbo.<TableName> --permissions "anonymous:*"

4. Start DAB

dab start

5. Make sure the tables in the database have the PK; otherwise, the DAB won't start


USEFUL URLS:

  • http://localhost:5000/api/<Entity>
  • http://localhost:5000/api/<Entity>/id/4
  • http://localhost:5000/api/<Entity>?$select=Name&$filter=where predicate
  • http://localhost:5000/graphql/
  • http://localhost:5000/swagger/index.html


Reference: 



No comments:

Create modal using HTML and CSS

<body>   <dialog id = "modal">      <div>        <h1>Title</h1>        <p>Sample Text</p...