Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gregorwolf/cap-websockets
CAP WebSockets Demo
https://github.com/gregorwolf/cap-websockets
Last synced: 11 days ago
JSON representation
CAP WebSockets Demo
- Host: GitHub
- URL: https://github.com/gregorwolf/cap-websockets
- Owner: gregorwolf
- Created: 2022-07-09T17:01:41.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-05-08T06:42:40.000Z (6 months ago)
- Last Synced: 2024-10-11T02:35:17.007Z (28 days ago)
- Language: JavaScript
- Size: 333 KB
- Stars: 5
- Watchers: 3
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# CAP WebSockets Demo
It contains these folders and files, following the recommended project layout:
| File or Folder | Purpose |
| -------------- | ------------------------------------ |
| `app/` | content for UI frontends goes here |
| `db/` | your domain models and data go here |
| `srv/` | your service models and code go here |
| `package.json` | project metadata and configuration |
| `readme.md` | this getting started guide |## Next Steps
- Open a new terminal and run `cds watch`
- (in VS Code simply choose _**Terminal** > Run Task > cds watch_)
- Start adding content, for example, a [db/schema.cds](db/schema.cds).## Learn More
Learn more at https://cap.cloud.sap/docs/get-started/.
## Local testing
After you've deployed the application you can run:
```bash
npm run bind:uaa
```to bind the local cap app for hybrid testing. For easy testing you also need to run an approuter. For this you have to store this `default-env.json`in the approuter folder:
```JSON
{
"VCAP_SERVICES": {
"xsuaa": [
{
"label": "xsuaa",
"provider": null,
"plan": "application",
"name": "cap-websockets-uaa",
"tags": ["xsuaa"],
"instance_name": "cap-websockets-uaa",
"binding_name": null,
"credentials": {
},
"syslog_drain_url": null,
"volume_mounts": []
}
]
},
"destinations": [
{
"name": "cap-websockets",
"url": "http://localhost:4004",
"forwardAuthToken": true
},
{
"name": "ui5",
"url": "https://ui5.sap.com"
}
]
}
```Then you can run
```
cds watch --profile hybrid
```in one terminal and
```
cd approuter
npm run start-local
```in another terminal.