1.0.42 • Published 5 years ago

faster-api-deploy v1.0.42

Weekly downloads
14
License
GNU General Publi...
Repository
github
Last release
5 years ago

faster-api-deploy

wrapper over express

sample code.

const RESTApi = require('faster-api-deploy');
const app = new RESTApi();

app.get("/returnExample", (req, res) => {

    return {
        message: "success"
    }
});

app.get("/hello", (req, res) => {
    res.status(200);

    return {
        message: "success"
    }
});

app.get("/error", async (req, res) => {
    await sleep(300);
    throw "ssssssssssssssssssssssss"
});

app.get("/sleep", async (req, res) => {
    await sleep(300);
    return {message: "hello world"};
});

const sleep = (time) => {
    return new Promise((res, rej) => {
        setTimeout(res, time);
    });
};

// app.startListening(9000, "dev", "REST Api");

// it's picking info from .env file in root
app.startListening();
1.0.42

5 years ago

1.0.41

5 years ago

1.0.40

5 years ago

1.0.39

5 years ago

1.0.38

5 years ago

1.0.37

5 years ago

1.0.36

6 years ago

1.0.35

6 years ago

1.0.34

6 years ago

1.0.33

6 years ago

1.0.32

6 years ago

1.0.31

6 years ago

1.0.30

6 years ago

1.0.29

6 years ago

1.0.28

6 years ago

1.0.27

6 years ago

1.0.26

6 years ago

1.0.25

6 years ago

1.0.24

6 years ago

1.0.23

6 years ago

1.0.22

7 years ago

1.0.21

7 years ago

1.0.20

7 years ago

1.0.19

7 years ago

1.0.18

7 years ago

1.0.17

7 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

1.0.0

7 years ago