1.0.7 • Published 4 years ago

xcofey v1.0.7

Weekly downloads
2
License
MIT
Repository
github
Last release
4 years ago

Make you developer life easier with this lib

Based in express, this lib is aimed at those who want something quick and easy, when it comes to developing APIs!

Getting started

First you need to install the lib

hello@world:~$ npm i xcofey

or

hello@world:~$ yarn add xcofey

Basics

Server

const { CreateServer } = require('xcofey');

CreateServer({
  port: 3000,
  controllers: [],
});

Controller (routes)

const { CreateController, Get, HttpError, HttpStatus } = require('xcofey');

const sayHelloWordRoute = Get('/hello', (req, res, next) => {
  try {
    return res.send('Hello Word!');
  } catch(error) {
    next(new HttpError(HttpStatus.INTERNAL_SERVER_ERROR, 'unexpected error');
  }
});

module.exports = CreateController('/', [sayHelloWordRoute]);

Docs -> coming soon

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago