0.1.1 • Published 6 years ago

express-formgen v0.1.1

Weekly downloads
-
License
MIT
Repository
-
Last release
6 years ago

express-formgen

img Build Status

What is it?

What express-formgen does, is generate forms so you only have to input simple data to generate complex forms. Primarily designed for login, register and contact forms. The config is very easy to learn!

Installation and tests

install with npm: npm i --save express-formgen test with npm: npm test

Example

app.js:

const app = require('express')();
const eform = require('express-formgen');
const cfg = require('./config');

eform(cfg)

app.use('/', eform.router);

app.listen(8080)

config.js:

module.exports = {
    title: "Login",
    action: "",
    method: "post",
    fields: [
        {
            type: "text",
            placeholder: "username",
            name: "username"
        },
        {
            type: "password",
            placeholder: "password",
            name: "password"
        }
    ]
};