changing readme.md style

This commit is contained in:
Dmitriynj
2020-11-30 13:09:00 +03:00
committed by Daniel Hutzel
parent bebc18a3e6
commit 4ebc20f8ce

View File

@@ -17,27 +17,68 @@ It contains these folders and files, following our recommended project layout:
| `readme.md` | this getting started guide |
| `server.js` | initial server set up |
## Start development steps
## Development
- 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
- Run `cds watch`. This will start cds service on 4004 port in watch mode
- 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
- 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
#### Better dev experience
```json
npm run deploy
```
- 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
- Next, start cds service on 4004 port in watch mode:
## Deployment steps
```json
cds watch
```
- 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:
```json
npm install
npm run watch
```
> 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:
>
> ```json
> npm run start
> ```
## Deployment
- Make sure you already have hanatrial instance in your cockpit dashboard (SAP Cloud Platform).
Or if you are using hana instance - change it in mta.yaml config file from hanatrial to hana
- Replace `"kind": "sql"` with `"kind": "hana"` in package.json require section
- Run `cf login` for Cloud Foundry authentication
- 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
- Run `mbt build -t ./`. This will create new build in `*.mtar` file
- Run `cf deploy <.mtar file>` # for example, media-store_1.0.0.mtar
- Change package.json db section
```json
"db": {
"kind": "hana"
}
```
- Authenticate in the Cloud Foundry:
```json
cf login
```
- Open `app-src` folder and run the following commands. This will create frontend production bundles in app subfolder:
```json
npm install
npm run build
```
- From root directory run:
```json
mbt build -t ./
cf deploy media-store_1.0.0.mtar
```
- Now your services should be deployed with hanatrial instance and filled with initial data
## Learn More
Learn more at https://cap.cloud.sap/docs/get-started/.
- [Learn more about CAP](https://cap.cloud.sap/docs/get-started/)
- [Deploying to Cloud Foundry](https://cap.cloud.sap/docs/advanced/deploy-to-cloud)