1.1.2 • Published 4 years ago

iotdb-express v1.1.2

Weekly downloads
7
License
Apache-2.0
Repository
github
Last release
4 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

4 years ago

1.1.1

4 years ago

1.0.25

5 years ago

1.0.24

5 years ago

1.0.23

6 years ago

1.0.22

6 years ago

1.0.21

6 years ago

1.0.20

6 years ago

1.0.19

6 years ago

1.0.18

6 years ago

1.0.17

6 years ago

1.0.16

7 years ago

1.0.15

7 years ago

1.0.14

7 years ago

1.0.13

7 years ago

1.0.12

7 years ago

1.0.11

7 years ago

1.0.10

7 years ago

1.0.9

7 years ago

1.0.8

7 years ago

1.0.7

7 years ago

1.0.6

7 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago