1.1.2 • Published 3 years ago

iotdb-express v1.1.2

Weekly downloads
7
License
Apache-2.0
Repository
github
Last release
3 years ago

iotdb-express

POP functions for dealing with Express

Samples

"use strict"

const _ = require("iotdb-helpers")
const express = require("iotdb-express")

/**
 */
const _page_home = _.promise(self => {
    _.promise(self)
        .validate(_page_home)

        .add("json", {
            "@type": "schema:Thing",
            "schema:name": "Hello, World",
        })
        .then(express.send.json)
        .catch(express.send.error_json(self))
})

_page_home.method = "_page_home"
_page_home.requires = {
    app: _.is.Object,
    request: _.is.Object,
    response: _.is.Object,
}
_page_home.produces = {
}

_.promise()
    .then(express.initialize)
    .then(express.take_self)
    .then(express.serve.get("/", _page_home))
    .then(express.listen.http.p("0.0.0.0", 4000))

    .catch(error => {
        delete error.self
        console.log("#", error)
    })
1.1.2

3 years ago

1.1.1

3 years ago

1.0.25

3 years ago

1.0.24

4 years ago

1.0.23

5 years ago

1.0.22

5 years ago

1.0.21

5 years ago

1.0.20

5 years ago

1.0.19

5 years ago

1.0.18

5 years ago

1.0.17

5 years ago

1.0.16

5 years ago

1.0.15

6 years ago

1.0.14

6 years ago

1.0.13

6 years ago

1.0.12

6 years ago

1.0.11

6 years ago

1.0.10

6 years ago

1.0.9

6 years ago

1.0.8

6 years ago

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago