- Notifications
You must be signed in to change notification settings - Fork286
Server Mode
Chris Diana edited this pageNov 21, 2018 ·3 revisions
In Server mode, CMS.js takes advantage of the Server's Directory Indexing feature. By allowing indexes, CMS.js sends an AJAX call to your specified folders and looks for Markdown or HTML files. After they are found, it takes care of everything else and delivers a full website.
Apache, NGINX,Node HTTP-Server,Node Ecstatic andPython SimpleHTTPServer servers are supported usingServer Mode.
For CMS.js to run, make sure to enable the directory indexing feature. You can do this two ways:
- Option #1: Enable .htaccess - If you have .htaccess enabled, you're good to go!
- Option #2: Apache config file - Add directory option to Apache configuration file
/etc/httpd/httpd.confor/etc/apache2/apache2.confmost likely:
<Directory /var/www/mysite.com/> Options Indexes</Directory>Make sure to restart Apache by either running/etc/init.d/httpd restart or/etc/init.d/apache2 restart.
Verify that yournginx.conf has theautoindex on option:
server { listen 80; root "path to the directory of files"; index index.html index.htm; server_name "name of the virtual host"; location / { try_files $uri $uri/ /index.html; autoindex on; autoindex_exact_size off; }}Install
$ npm install -g http-serverThen, run in the directory where CMS.js is
$ http-server my-cms-js-blog/