auto-cms
Auto turn any webpage into editable CMS without coding.
![npm Package Version](https://img.shields.io/npm/v/auto-cms-server)
Features
Enhancement
Usage
Usage with installation to lock the version:
npm i -D auto-cms-server
npx auto-cms-server
Usage without installation:
npx -y auto-cms-server
API
Submit Contact Form
Method: POST
Pathname: /contact
Content-Type: application/x-www-form-urlencoded or application/json
Accept: text/html or application/json
Body Fields:
- name
- email
- tel
- company_name
- business_nature
- remark
All body fields are optional.
If you want to store additional information, you may store them as JSON in the remark
field.
If the Accept
is application/json
, the response will be a json object with optional error
string; otherwise the response will be a html page.
The response file can be configured in the env variable SUBMIT_CONTACT_RESULT_PAGE
. If it is not specified, or specified as default
, a simple html page will be response as below:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Submitted</title>
</head>
<body>
<p>Your submission has been received.</p>
${error ? `
<pre><code>${escapeHTML(error)}</code></pre>
` : ''}
<p>Back to <a href="/">home page</a>.</p>
</body>
</html>
License
This project is licensed with BSD-2-Clause
This is free, libre, and open-source software. It comes down to four essential freedoms [ref]:
- The freedom to run the program as you wish, for any purpose
- The freedom to study how the program works, and change it so it does your computing as you wish
- The freedom to redistribute copies so you can help others
- The freedom to distribute copies of your modified versions to others