New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

flask-node

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

flask-node

similar to python Flask web-framework

latest
Source
npmnpm
Version
0.5.2
Version published
Maintainers
1
Created
Source

Flask-node

Similar to python Flask web-framework

Install

You can use npm or yarn install the Flask-node

npm install flask-node --save
// or
yarn add flask-node --save

Usage

/** Typescript app.ts */
import { Flask, Router, Request, Response } from 'flask-node';

const app = new Flask(__dirname);
const router = new Router();

function indexHandle(req: Request, res: Response) {
    res.end('Hello world');
}

router.add('/', indexHandle);

app.run({ port: 5051 });

or

/** Javascript app.js */
const { Flask, Router } = require('flask-node');
const app = new Flask(__dirname);
const router = new Router();

function indexHandle(req, res) {
    res.end('Hello world');
}
router.add('/', indexHandle);

app.run({ port: 5051 });
// run app
node app.js // ==> Server is run on http://localhost:5051

// use curl test app.js
curl http://localhost:5051 // ==> Hello world

Features

  • Support dynamic routing
  • Support HTML template engine (use Swig)
  • Natice support HTTP body parse (use formidable)

Documentation

Test

run npm test

Contribution

  • fork this repo
  • run npm install install dependencies
  • write your code and run git cz commit your code
  • run npm test and ensure that all tests pass
  • pull request , tks

License

MIT © Lleohao

Keywords

flask

FAQs

Package last updated on 09 Jan 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts