Feathers.js Backend Services with Python Scripts
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
lib
test
.editorconfig
.eslintrc.json
.gitignore Initial commit Dec 24, 2016
.jshintrc basic setup Dec 25, 2016
.travis.yml
LICENSE
README.md
package-lock.json
package.json

README.md

fython - feathers-python

Node.js module for creating Feathers.js Backend Services based on Python Scripts

Travis Status Downloads Greenkeeper badge FOSSA Status

Requirements

  • node.js
  • Python2

Setup

  1. Go into your project folder and enter npm install feathers-python

Usage

Given this python-script in 'test/helloWorld.py':

import sys as sys
print("Hello " + sys.argv[1] + "!")

Use this in your Feathers.js App:

const FythonService = require('feathers-python')

// given a feathers-app
app = feathers();

// register a python service to your app
app.use('/pythonScript', new FythonService({scriptPath: 'test/helloWorld.py'}));

// use the python service
service = app.service('pythonScript');
// POST /pythonScript
service.create({
  param1: 'Test'
}).then((result) => {
  console.log(result); // logs "Hello Test!"
});

Testing

Run tests

  1. Go into project folder
  2. run npm test

License

FOSSA Status