Get Started
Usage API
Using WOPI
Additional API
More information
|
How to integrate online editors into your own website on Node.jsOverviewThis example will help you integrate ONLYOFFICE Docs into your web application on Node.js.
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!
If you enabled any of the test examples, disable it before going for production.
Important security infoPlease keep in mind the following security aspects when you are using test examples:
For WindowsStep 1. Install ONLYOFFICE DocsDownload and install ONLYOFFICE Docs (packaged as Document Server). See the detailed guide to learn how to install Document Server for Windows. Step 2. Download the Node.js code for the editors integrationDownload the Node.js example from our site. To connect the editors to your website, specify the path to the editors installation and the path to the storage folder in the config/default.json file: "storageFolder": "./files" "storagePath": "/files" "siteUrl": "https://documentserver/" where the documentserver is the name of the server with the ONLYOFFICE Document Server installed, the storageFolder and storagePath are the paths where files will be created and stored. You can set an absolute path. For example, D:\\folder. Please note that on Windows OS the double backslash must be used as a separator. If you want to experiment with the editor configuration, modify the parameters in the \views\editor.ejs file. Step 3. Install Node.js environmentInstall the node.js environment which is going to be used to run the Node.js project. Please follow the link at the official website choosing the correct version for your Windows OS (32-bit or 64-bit). Step 4. Run the Node.js codeWe will run the code in Node.js runtime environment and will interact with it using the command line interface (cmd).
Step 5. Check accessibilityIn 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 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. If you integrated the editors successfully the result should look like the demo preview on our site. For LinuxStep 1. Install ONLYOFFICE DocsDownload and install ONLYOFFICE Docs (packaged as Document Server). See the detailed guide to learn how to install Document Server for Linux. Step 2. Install the prerequisites and run the website with the editors
Step 3. Check accessibilityIn 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 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. If you integrated the editors successfully the result should look like the demo preview on our site. |