Skip to content

handsoncode-apps/datasource-node

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

195 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

datasource-node

Node.js data source generator for your Handsontable. Works great with datasource-connector plugin. This generator will generate the express js route (controller) and view (pug) based on communication specification

Installation

Steps to install this package

$ npm i handsoncode-apps/datasource-node -g

Basic Usage

Generate new express js application with Handsontable spreadsheet

This example show how to create new express js application with Handsontable spreadsheet in 5 easy steps.

  1. Create express js app with pug view
$ npm install express-generator -g
$ express --view=pug myapp
  1. Generate Handsontable controller and install corresponding pug view with communication plugin
$ cd myapp
$ datasource-node myController --engine pug --assets private
  1. Install required packages
$ npm install

The generator will create 2 files and download latest assets:

  • route/myController.js - communication methods stub
  • view/myController.pug - frontend html view and handsontable initalization
  • private/css/handsontable.min.css (handsontable css)
  • private/js/handsontable.full.js (handsontable js)
  • private/js/datasource-connector.full.js (handsontable data REST data source plugin)
  1. Insert below lines to your app.js just after var app = express();
const myController = require('./routes/myController');
app.use('/myController', myController);
app.use(express.static('private'));
  1. run server by execute command
$ npm start

The generated project will be on:

http://localhost:3000/myController

Advanced usage

Generate express js router only

$ cd myapp
$ datasource-node myController --engine manual

The generator will create file:

  1. The route/myController.js with the methods stub

Generate express js router and static assets

$ cd myapp
$ datasource-node myController --engine manual --assets private

The generator will create files:

  1. The route/myController.js with the methods stub And download the latest release version of:
  2. The ~/assets/js/datasource-connector.full.js
  3. The ~/assets/js/handsontable.full.js
  4. The ~/assets/css/handsontable.min.css

This generator will NOT update your app.js file, you need to do it manually (please see the generator output).

In case of assets, remember to add it to your static folder.

About

Node.js data source for your Handsontable. Works great with datasource-connector plugin.

Resources

Stars

1 star

Watchers

4 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors