Folder structure and routing
Each subfolder under endpoints/ corresponds to an endpoint type. The folder name within each type becomes the endpoint name in the API URL. Portway watches these folders and reloads configuration when files change.
In practice this means Portway derives your API routes from the endpoints/ folder hierarchy, so there is no route registration step at all. When you want different naming, the Namespace and DisplayName attributes let you override the derived route; that's an advanced setup covered further down.
Directory layout
PortwayApi/
├── appsettings.json
├── web.config
├── *.db
├── log/
├── tokens/
├── environments/
│ ├── settings.json
│ ├── dev/
│ │ └── settings.json
│ ├── test/
│ │ └── settings.json
│ └── prod/
│ └── settings.json
└── endpoints/
├── SQL/
│ └── Inventory/ # namespace
│ └── Products/
│ └── entity.json
├── Proxy/
│ ├── Accounts/ # no namespace
│ │ └── entity.json
│ └── Financial/
│ └── SalesOrder/
│ └── entity.json
├── Webhooks/
│ └── Integrations/
│ └── Inbound/
│ └── entity.json
├── Files/
│ ├── CustomerData/
│ │ └── entity.json
│ └── Images/
│ └── entity.json
└── Static/
└── Masterdata/
└── Countries/
└── entity.jsonRoute patterns
| Endpoint type | Folder path | URL pattern |
|---|---|---|
| SQL | endpoints/SQL/[{Namespace}/]{Name}/entity.json |
/api/{env}/[{Namespace}/]{Name} |
| Proxy | endpoints/Proxy/[{Namespace}/]{Name}/entity.json |
/api/{env}/[{Namespace}/]{Name} |
| Composite | endpoints/Proxy/[{Namespace}/]{Name}/entity.json (Type: Composite) |
/api/{env}/[{Namespace}/]{Name} |
| Webhook | endpoints/Webhooks/{Namespace}/{Name}/entity.json |
/api/{env}/{Namespace}/{Name}/{id} |
| File | endpoints/Files/[{Namespace}/]{Name}/entity.json |
/api/{env}/files/[{Namespace}/]{Name} |
| Static | endpoints/Static/[{Namespace}/]{Name}/entity.json |
/api/{env}/[{Namespace}/]{Name} |
Segments in square brackets are optional: add a namespace folder and it becomes part of the URL, leave it out and the endpoint sits directly under the environment. The endpoint name in the URL is case-sensitive and matches the folder name exactly.
Folder permissions
Grant the IIS Application Pool identity read/write access to the deployment directory:
# ApplicationPoolIdentity
icacls "C:\Apps\Portway" /grant "IIS AppPool\PortwayAppPool:(F)" /T /C
# Custom service account
icacls "C:\Apps\Portway" /grant "DOMAIN\SVC_PORTWAY:(F)" /T /C| Folder | Minimum permission | Reason |
|---|---|---|
log/ |
Read/Write | Log file creation and rotation |
tokens/ |
Read/Write | Token file management |
environments/ |
Read | Configuration reads |
endpoints/ |
Read | Configuration reads |
| Root | Read/Write | auth.db and temporary files |
WARNING
Do not expose the deployment directory via web browsing. Verify that web.config disables directory listing.
Next steps
- Environments
- SQL Endpoints
- Proxy Endpoints
- HTTP Methods: which verbs each endpoint type accepts
Portway