Skip to content

Commit 82c3c0d

Browse files
committed
Move config to index.csp
1 parent e8ed958 commit 82c3c0d

File tree

4 files changed

+35
-28
lines changed

4 files changed

+35
-28
lines changed

README.md

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
1-
# RESTFormsUI-react
2-
3-
This project is implementation of RESTForms UI built with React.
4-
It also uses [Antd](https://ant.design/) as main UI library.
5-
6-
In future project will migrate to React 16 and Antd 3+.
7-
8-
**To build this project you need Node 6+ installed. Or you can grab latest stable version from Releases tab.**
9-
10-
## How to build
11-
12-
1. Pull the repository and navigate to the repository folder
13-
2. Open `src/api/config.js` and change server line to address of your rest application.
14-
3. Open a local terminal or command line and execute next commands:
15-
```
16-
npm install
17-
npm run build
18-
```
19-
20-
The production files will be placed in `dist` folder. Copy it to your CSP-application folder and use as general CSP-app.
21-
22-
**For authentication**
23-
Use built `login.csp` page as custom Caché Login Page for your application. Set cookies path to the same value for both rest and client app.
24-
25-
**README will be updated**
1+
# RESTFormsUI-react
2+
3+
This project is implementation of RESTForms UI built with React.
4+
It also uses [Antd](https://ant.design/) as main UI library.
5+
6+
In future project will migrate to React 16 and Antd 3+.
7+
8+
**To build this project you need Node 6+ installed. Or you can grab latest stable version from Releases tab.**
9+
10+
## How to build
11+
12+
1. Pull the repository and navigate to the repository folder
13+
2. Open `index.csp` and change server line to address of your rest application.
14+
3. Open a local terminal or command line and execute next commands:
15+
```
16+
npm install
17+
npm run build
18+
```
19+
20+
The production files will be placed in `dist` folder. Copy it to your CSP-application folder and use as general CSP-app.
21+
22+
**For authentication**
23+
Use built `login.csp` page as custom Caché Login Page for your application. Set cookies path to the same value for both rest and client app.
24+
25+
**README will be updated**

src/api/catalogApi.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import rest from './rest';
2-
import { server } from "./config";
2+
const server = window.__INITIAL_STATE__.config.server;
33

44
class CatalogApi {
55

src/api/config.js

Lines changed: 0 additions & 2 deletions
This file was deleted.

src/index.csp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,15 @@
88
<title>Сахалинский областной медицинский информационно-аналитический центр</title>
99

1010
<script>
11+
var initialState = {
12+
config: {
13+
// should be changed to actual path of rest application
14+
server: 'http://localhost:57773/sah/rest'
15+
},
16+
};
17+
window.__INITIAL_STATE__ = initialState;
18+
19+
1120
var cspSessionTimeout = (+'#(%session.AppTimeout)#' + 15) * 1000;
1221
var cspSessionTimer;
1322
var userName = ('#(%session.Username)#');

0 commit comments

Comments
 (0)