0.1.21 • Published 3 years ago

logan-api v0.1.21

Weekly downloads
-
License
MIT
Repository
-
Last release
3 years ago

Logan API

Logan API is a minimal rest API library for projects in Express, Typescript and Mongoose.

Installation

Use the package manager npm to install Logan.

npm install --save logan

or

yarn add logan

Usage

import { Server } from '@pachecoio/logan'

const server = new Server();

@server.get('/')
function hello(req: Request) {
  return 'hello';
}

server.start();

Database connection

To connect with a Mongo Database, it is as simple as having a running instance of MongoDB ready and updating the url under the .env file

# .env
MONGODB_URI=<YOUR MONGODB URI>
...

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

License

MIT