Start and stop the CAP dev server, read the startup output, access the service explorer, and handle common startup errors.
cds watch is the primary development command for CAP. It watches your files and restarts the server on every change.
cd my-cap-app
cds watch
cds serve all --with-mocks --in-memory?
...
[cds] - model loaded from 2 file(s):
db/schema.cds
srv/cat-service.cds
[cds] - connect to db > sqlite { database: ':memory:' }
[cds] - serving CatalogService { path: '/catalog', impl: 'srv/cat-service.js' }
[cds] - server listening on { url: 'http://localhost:4004' }
[cds] - launched at ... in: 842ms
[cds] - [ terminate with ^C ]
Line by line:
- model loaded — which .cds files were compiled
- connect to db — SQLite in-memory (default for local dev)
- serving CatalogService — the OData path and optional JS handler
- localhost:4004 — the URL to open
Open http://localhost:4004 in a browser. You'll see:
$metadata)http://localhost:4004/catalog/Products
http://localhost:4004/catalog/Products?$top=5&$orderby=name
http://localhost:4004/catalog/Products?$filter=price gt 10
Press Ctrl+C in the terminal.
Cannot find module '@sap/cds'npm install # install project dependencies first
Port 4004 already in use# macOS / Linux
lsof -ti:4004 | xargs kill
# Windows
netstat -ano | findstr :4004
taskkill /PID <pid> /F
Error: No model foundYour .cds files have a syntax error. Check the line number in the error output.
cds watch --port 4005 # different port
cds watch --log-level debug # verbose output (shows SQL queries)
cds watch --profile production # use production config profile
Sign in for progress tracking & Q&A →