You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 29, 2025. It is now read-only.
Copy file name to clipboardExpand all lines: media-store/README.md
+54-13Lines changed: 54 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,27 +17,68 @@ It contains these folders and files, following our recommended project layout:
17
17
|`readme.md`| this getting started guide |
18
18
|`server.js`| initial server set up |
19
19
20
-
## Start development steps
20
+
## Development
21
21
22
-
- At first open a new terminal and run `npm run deploy`. It should create new sqlite source and fill initial data from `db/data`. You can browse database in any sqlite client
23
-
- Run `cds watch`. This will start cds service on 4004 port in watch mode
24
-
- Open `app-src` folder and run `npm install` and `npm run watch`. This will install dependencies and run frontend src files watcher. When you will change src files your bundles in app folder will re-compiled. Now you can enjoy development
22
+
- At first open a new terminal and run below command. It should create new sqlite source and fill initial data from `db/data`. You can browse database in any sqlite client
25
23
26
-
#### Better dev experience
24
+
```json
25
+
npm run deploy
26
+
```
27
27
28
-
-You can use webpack-dev-server to rapid frontend development. Instead of running watcher in `app-src` do `npm run start`. This will start frontend dev server on 3000 port. Now your bundles will be hot reloaded, this means you do not need reload the page to see changes
28
+
-Next, start cds service on 4004 port in watch mode:
29
29
30
-
## Deployment steps
30
+
```json
31
+
cds watch
32
+
```
33
+
34
+
- Open `app-src` folder and run next commands. This will install dependencies and run frontend src files watcher. When you will change src files your bundles in app directory will re-compiled. Now you can enjoy development:
35
+
36
+
```json
37
+
npm install
38
+
npm run watch
39
+
```
40
+
41
+
> For better frontend development experience use below command instead of watcher. This will start frontend dev server on 3000 port. Now your bundles will be hot reloaded, this means you do not need reload the page to see changes:
42
+
>
43
+
> ```json
44
+
> npm run start
45
+
> ```
46
+
47
+
## Deployment
31
48
32
49
- Make sure you already have hanatrial instance in your cockpit dashboard (SAP Cloud Platform).
33
50
Or if you are using hana instance - change it in mta.yaml config file from hanatrial to hana
34
-
- Replace `"kind": "sql"` with `"kind": "hana"` in package.json require section
35
-
- Run `cf login` for Cloud Foundry authentication
36
-
- Open `app-src` folder and run `npm install` if you are haven't done this and `npm run build`. This will create frontend production bundles in app subfolder
37
-
- Run `mbt build -t ./`. This will create new build in `*.mtar` file
38
-
- Run `cf deploy <.mtar file>` # for example, media-store_1.0.0.mtar
51
+
- Change package.json db section
52
+
53
+
```json
54
+
"db": {
55
+
"kind": "hana"
56
+
}
57
+
```
58
+
59
+
- Authenticate in the Cloud Foundry:
60
+
61
+
```json
62
+
cf login
63
+
```
64
+
65
+
- Open `app-src` folder and run the following commands. This will create frontend production bundles in app subfolder:
66
+
67
+
```json
68
+
npm install
69
+
npm run build
70
+
```
71
+
72
+
- From root directory run:
73
+
74
+
```json
75
+
mbt build -t ./
76
+
cf deploy media-store_1.0.0.mtar
77
+
```
78
+
39
79
- Now your services should be deployed with hanatrial instance and filled with initial data
40
80
41
81
## Learn More
42
82
43
-
Learn more at https://cap.cloud.sap/docs/get-started/.
83
+
-[Learn more about CAP](https://cap.cloud.sap/docs/get-started/)
84
+
-[Deploying to Cloud Foundry](https://cap.cloud.sap/docs/advanced/deploy-to-cloud)
0 commit comments