Update README.md

This commit is contained in:
hellonadya
2021-05-17 16:18:52 +03:00
committed by GitHub
parent 9cea54a949
commit c780ed127c

View File

@ -1,26 +1,22 @@
# How to integrate online editors into your own web site on Node.js
## Overview
## Introduction
This example will help you integrate ONLYOFFICE Docs into your web application on Node.js.
To integrate **ONLYOFFICE online editors** into your own website on **Node.js** you need to download and install ONLYOFFICE editors on your local server and use the [Node.js Example](https://api.onlyoffice.com/editors/demopreview) for their integration. We will show you how to run the Node.js example on [Windows OS](#running-the-example-on-windows-os) and [Linux OS](#running-the-example-on-linux-os).
It is aimed at testing the editors. Please, do not use it for production without proper modifications.
Please nore that the integration examples are used to demonstrate document editors functions and the ways to connect **Document Server** to your own application. **DO NOT USE** these examples on your own server without **PROPER CODE MODIFICATIONS**!
## For Windows
This guide will show you the sequence of actions to integrate the editors successfully.
### Step 1. Install Document Server
## Running the example on Windows OS
Download and install ONLYOFFICE Docs (packaged as Document Server).
## Step 1. Download and Install Document Server
See the detailed guide to learn how to [install Document Server for Windows](https://helpcenter.onlyoffice.com/installation/docs-developer-install-windows.aspx).
First, download the [**ONLYOFFICE Editors**](https://api.onlyoffice.com/editors/demopreview) (the ONLYOFFICE Document Server).
See the detailed guide to learn how to [install Document Server for Windows](https://helpcenter.onlyoffice.com/installation/docs-developer-install-windows.aspx?from=api_nodejs_example).
## Step 2. Download the Node.js code for the editors integration
### Step 2. Download the Node.js code for the editors integration
Download the [Node.js example](https://api.onlyoffice.com/editors/demopreview) from our site.
You need to connect the editors to your web site. For that specify the path to the editors installation in the *config/default.json* file:
You need to connect the editors to your website. Specify the path to the editors installation in the *config/default.json* file:
```
"siteUrl": "https://documentserver/"
@ -30,11 +26,11 @@ where the **documentserver** is the name of the server with the ONLYOFFICE Docum
If you want to experiment with the editor configuration, modify the [parameters](https://api.onlyoffice.com/editors/advanced) it the *\views\editor.ejs* file.
## Step 3. System requirements
### Step 3. Install Node.js environment
Download and install the **node.js** environment which is going to be used to run the Node.js project. Please follow the link at the official website: https://nodejs.org/en/download/, choosing the correct version for your Windows OS (32-bit or 64-bit).
Install the **node.js** environment which is going to be used to run the Node.js project. Please follow the link at the official website: https://nodejs.org/en/download/ choosing the correct version for your Windows OS (32-bit or 64-bit).
## Step 4. Running the Node.js code
### Step 4. Run the Node.js code
We will run the code in Node.js runtime environment and will interact with it using the command line interface (cmd).
@ -66,17 +62,19 @@ We will run the code in Node.js runtime environment and will interact with it us
## Step 5. Checking accessibility
In case the example and Document Server are installed on different computers, make sure that your server with the example installed has access to the Document Server with the address which you specify instead of **documentserver** in the configuration files. And you must also make sure that the Document Server in its turn has access to the server with the example installed with the address which you specify instead of **example.com** in the configuration files.
In case the example and Document Server are installed on different computers, make sure that your server with the example installed has access to the Document Server with the address which you specify instead of **documentserver** in the configuration files.
## Running the example on Linux OS
Make sure that the Document Server has access to the server with the example installed with the address which you specify instead of **example.com** in the configuration files.
## Step 1. Download and Install Document Server
## For Linux
First, download the [**ONLYOFFICE Editors**](https://api.onlyoffice.com/editors/demopreview) (the ONLYOFFICE Document Server).
### Step 1. Install Document Server
See the detailed guide to learn how to [install Document Server for Linux](https://helpcenter.onlyoffice.com/installation/docs-developer-install-ubuntu.aspx?from=api_nodejs_example).
Download and install ONLYOFFICE Docs (packaged as Document Server).
## Step 2. Install the prerequisites and run the web site with the editors
See the detailed guide to learn how to [install Document Server for Linux](https://helpcenter.onlyoffice.com/installation/docs-developer-install-ubuntu.aspx).
## Step 2. Install the prerequisites and run the website with the editors
1. Install **Node.js**:
@ -88,7 +86,7 @@ See the detailed guide to learn how to [install Document Server for Linux](https
sudo apt-get install -y nodejs
```
2. Download the archive with the Node.js example and unpack the archive:
2. Download the archive with the Node.js example and unpack it:
```
wget https://api.onlyoffice.com/app_data/editor/Node.js%20Example.zip
@ -138,4 +136,6 @@ See the detailed guide to learn how to [install Document Server for Linux](https
## Step 3. Checking accessibility
In case the example and Document Server are installed on different computers, make sure that your server with the example installed has access to the Document Server with the address which you specify instead of **documentserver** in the configuration files. And you must also make sure that the Document Server in its turn has access to the server with the example installed with the address which you specify instead of **example.com** in the configuration files.
In case the example and Document Server are installed on different computers, make sure that your server with the example installed has access to the Document Server with the address which you specify instead of **documentserver** in the configuration files.
Make sure that the Document Server has access to the server with the example installed with the address which you specify instead of **example.com** in the configuration files.