Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/jmoiron/contact-form

server that implements an email contact form for an otherwise static website
https://github.com/jmoiron/contact-form

Last synced: about 2 months ago
JSON representation

server that implements an email contact form for an otherwise static website

Awesome Lists containing this project

README

        

# contact-form

[![license](http://img.shields.io/badge/license-MIT-red.svg?style=flat)](https://raw.githubusercontent.com/jmoiron/contact-form/master/LICENSE)

A simple stand-alone web server which implements a contact form on an
otherwise static website.

Contains code from [Alex Edward's Form Validation blog post](http://www.alexedwards.net/blog/form-validation-and-processing)
which is [licensed under the MIT
licence](https://twitter.com/ajmedwards/status/580082588879970305).

## usage

If you run `contact-form` in a directory, it will serve up everything in that
directory as a static file in the same way a server like `nginx` or `apache`
would, defaulting to `index.html` when a "directory" is accessed.

It also sets up a listener on `/contact/`, which does a few things:

* You can `POST` with `email`, `subject`, and `message` to attempt to send
an email. This returns a json message `{"success": true}` on success and
`{"success": false, "error": "