Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KLD client is running on top the development mode of webpack. It is better to give configuration and documentation to guide users to understand how they are running development using web pack and how is the steps to deploy KLD in a web server or running built-in Node.js server #1

Open
vorachet opened this issue Dec 17, 2016 · 4 comments

Comments

@vorachet
Copy link
Member

No description provided.

@vorachet vorachet changed the title KLD client is running in development of webpack. It is better to give configuration and documentation to guide users to understand how they are running development using web pack and how is the steps to deploy KLD in a web server or running built-in Node.js server KLD client is running on top the development mode of webpack. It is better to give configuration and documentation to guide users to understand how they are running development using web pack and how is the steps to deploy KLD in a web server or running built-in Node.js server Dec 17, 2016
@vorachet
Copy link
Member Author

We will be going to add script to build JS files and save output into a directory that allows the user can copy and paste KLD client on a web server such NGINX or Apache

@vorachet
Copy link
Member Author

The current run script "npm start" in KLD client will run webpack development mode that allows developers running KLD client locally for testing but this is not recommended for demo purpose. we should provide built-in web server in Node.js that serves KLD client which is written in Angular for users who want to use a simple Node.js web server within the project rather than running NGINX or and Apache. By the way, providing predefined scripts for this improvement should be managed in package.json, so developers and users can choose the right deployment for KLD client.

@vorachet
Copy link
Member Author

This is a Apache configuration we use it before in our recent testing server.

Template

<VirtualHost *:80>

    ServerName {domain}
    ServerAdmin webmaster@localhost
    DocumentRoot {assetPath}

    ErrorLog ${APACHE_LOG_DIR}/{whiteLabelAppName}.error.log
    CustomLog ${APACHE_LOG_DIR}/{whiteLabelAppName}.access.log combined

    RewriteEngine On
    RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -f [OR]
    RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -d
    RewriteRule ^ - [L]
    RewriteRule ^ /index.html

With 127.0.0.1 IP example:

NameVirtualHost 127.0.0.1

<VirtualHost 127.0.0.1:80>
ServerName 127.0.0.1
DocumentRoot /var/www/KLD/client/asset.default
RewriteEngine On
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -f [OR]
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -d
RewriteRule ^ - [L]
RewriteRule ^ /index.html

@vorachet
Copy link
Member Author

Run KLD Client. There are 3 ways you can run KLD client in different contexts.

Run KLD Client in Development Mode

With Development Mode, you will run a simple web server that watches all KLD client source files. Each source file will be watched by the KLD build system and entire KLD client web app will be built automatically and the result of the change will be updated on the web browser in real-time when developers make a change on files under src folder.

cd KLD/client

npm start

Open http://localhost:9000

Run KLD Client using Built-In Node.js web server

With Built-In Node.js web server, you will run KLD client using a built-In Node.js based web server. Yuri have the build KLD client source files using “npm run build”, which the built files will be saved in asset.default folder. You can start the web server using “npm run server” command line.

cd KLD/client

npm run build

npm run server

Open http://localhost:3000

Run KLD Client on an Apache Web Server

You can reuse Apache Web Server to run KLD client which allows you configure advanced web application deployment.

cd KLD/client

npm run build

use “asset.default” folder as an Apache document root folder

If you want to setup an Apache virtual host, the following is the example of KLD client virtual host setting. To assume that your server IP is 192.168.0.100 and your KLD GIT repo is relocated at /var/www/KLD

NameVirtualHost 192.168.0.100
<VirtualHost 192.168.0.100:80>
ServerName 192.168.0.100
DocumentRoot /var/www/KLD/client/asset.default
RewriteEngine On
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -f [OR]
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} -d
RewriteRule ^ - [L]
RewriteRule ^ /index.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant