Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 5c6af92

Browse files
nelsonicmckennapsean
authored andcommitted
Version-Two (#23)
* update version of Hapi to v13.0.0 fixes #22 * remove hapi, inert & nodemon. replaced with live-server! fixes #80 and closes #22 discussed in #23 (comment) * add clarifications and spellchecks to live-js section * remove old hapi server file
1 parent e9a3dcf commit 5c6af92

File tree

3 files changed

+39
-22
lines changed

3 files changed

+39
-22
lines changed

‎README.md‎

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,39 @@ Follow Steps 4, 5 & 6 to save a new version and ***re-publish*** the script.
227227
![17-confirm-data-inserted](https://cloud.githubusercontent.com/assets/194400/10582676/eb8af5d8-7680-11e5-92bb-30dd08d2d7b3.png)
228228

229229

230+
### _Live_ Server (_on your `localhost`_)
231+
232+
Because we are loading external **.js** files, our web browser
233+
will not _allow_ us to simply open the **index.html** from a
234+
local directory for testing out the form.
235+
236+
Open your terminal and run this command
237+
to _**install** the **node modules** and **start** the **live server**_:
238+
239+
```sh
240+
npm install live-server --save-dev && node_modules/.bin/live-server --port=8000
241+
```
242+
243+
It will take a minute to install,
244+
but once that's done your `live-server` will start up.
245+
246+
That starts a node.js HTTP server on port 8000
247+
and opens the form you just created in your default browser.
248+
If you wish to edit the styles in **style.css** or the
249+
client-side Javascript in **form-submission-handler.js**,
250+
please be sure to update `index.html` to load those resources
251+
locally rather than via GitHub.
252+
253+
> **Note**: This is a _light_ taste of Node.js for absolute beginners.
254+
You do **not** need node.js to "deploy" this form,
255+
you can run it on an **_any_ web server** that serves HTML/CSS/JavaScript.
256+
If you have never used Node.js before, see: http://nodeguide.com/beginner.html
257+
but for the purposes of this exercise (_submitting a form **without** a server_)
258+
you _don't **need**_ node.js or `live-server`
259+
it's just a _nice_ thing to have when you are creating
260+
your form because it automatically re-loads the page when you make changes in your text editor!
261+
262+
230263
# *Want more*?
231264

232265
If you want us to take this tutorial further, [***please let us know***!](https://github.com/nelsonic/html-form-send-email-via-google-script-without-server/issues)
@@ -253,6 +286,8 @@ e.g:
253286
Let us know if you have any questions!
254287

255288

289+
290+
256291
## Background Reading
257292

258293
+ Google Apps Scripts Basics: https://developers.google.com/apps-script/articles

‎package.json‎

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
{
22
"name": "html-form-send-email-via-google-script-without-server",
3-
"version": "1.0.0",
4-
"description": "tutorial showing how to save data to a google doc spreadsheet from any html form (including sending emails!)",
3+
"version": "2.0.0",
4+
"description": "Tutorial showing how to save data to a google doc spreadsheet from any html form (including sending emails!)",
55
"main": "static-server.js",
66
"scripts": {
7-
"start": "./node_modules/.bin/nodemon static-server.js"
7+
"start": "node_modules/.bin/live-server --port=8000"
88
},
99
"repository": {
1010
"type": "git",
@@ -24,8 +24,6 @@
2424
},
2525
"homepage": "https://github.com/dwyl/html-form-send-email-via-google-script-without-server#readme",
2626
"devDependencies": {
27-
"hapi": "^11.1.2",
28-
"inert": "^3.2.0",
29-
"nodemon": "^1.8.1"
27+
"live-server": "^1.2.0"
3028
}
3129
}

‎static-server.js‎

Lines changed: 0 additions & 16 deletions
This file was deleted.

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /