npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@knetik/micro-express

v3.1.10

Published

This package adds the an express http server to any [micro-core](https://www.npmjs.com/package/@knetik/micro-core) application as a Core Adaptor

Downloads

69

Readme

Knetik Micro Express

This package adds the an express http server to any micro-core application as a Core Adaptor

Install

$ npm install @knetik/micro-express

Then add the CORE_ADAPTORS config to your config/environments/*.json files

"CORE_ADAPTORS": [ '@knetik/micro-express' ]

Express

Sets up an http web server built with Express and Run when calling Core.serve(app_root_path). Routes are stored in app/routes and should be wrapped in a function with a single Server parameter.

Multi tenancy is handled on a per request basis using an express middleware. Core.connect(app_id, bearer_token) is called internally returning an app instance scoped to the client and attaching it to the request object. Access to the App instance is demonstrated in the example route.

Multi tenant resolution is keys on the requesting app_id. The app_id is resolved from the first sub domain segment of the requesting domain or from the configured APP_ID_KEY request header. Which defaults to x-knetikcloud-appid

Service Auto Load

Set the AUTO_LOAD_SERVICE_ROUTES env var to true. This will load the modules inside app/services as routes and apply a default route to each service. Config options are available for a auto loaded service. Refer to the DOCS for more info on how to configure auto loaded service routes

Navigate to /routes for a list of the auto loaded routes. If the AUTO_LOAD_SERVICE_ROUTES var is not set, this route will not be available.

Swagger

Swagger json and swagger ui are supported through jsdoc parsing and an express static route.

  • use swagger yaml syntax in a doc block - https://github.com/knetikmedia/micro-core/blob/master/app/routes/example.js#L3-L28
  • view the auto generated swagger.json file - /swagger.json
  • render the swagger ui - /swagger-ui