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

richmond-web-controller

v0.1.9

Published

Richmond Web Controller

Downloads

7

Readme

Richmond Web Controller

Official Demo Web controller for richmond.js

This package is the official demo Web controller for the richmond.js package.

Installation

$ npm init
$ npm install richmond --save
$ npm install richmond-web-controller --save

Usage and Documentation

Because this is the official demo controller for the richmond.js core library, it is heavily documented in that package.

You can find the documentation here:

Summary of Features

  • Richmond Web Controller
  • All requests take the form of: http [ s ] ://host [ :port ] / prefix / :model [ / :id ]
    • port is provided by richmond.js
    • prefix is provided by richmond.js
    • model is the name of the MongoDB collection
    • id is the optional MongoDB id passed in if a request requires it
  • Connects to MongoDB
  • Supports all HTTP methods:
    • DELETE
    • GET - single record (getOne) and collections (getMany)
    • POST
    • PUT
    • PATCH
  • Supports requests and responses in JSON format (Content-Type: application/json).
  • Supports Multiple Models
  • Supports SSL:
    • 404 - if a Non-SSL request is made, will return 404 (not found).
    • 302 - if a Non-SSL request is made, will return 302 (moved) and redirect to the SSL equivalent.
  • Supports richmond.js token management.
  • Supports rights management through tokens.
  • Supports wrappers for intercepting requests before and after they are made.

Tests

Run the tests in one of the following two ways:

$ mocha --timeout 20000

Or

$ npm test

The tests generate log files in a logs/ folder under the projects root folder.


Repos


Contributing

In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code.


Version History

Version 0.1.9 release notes

  • brought code coverage up to 82%

Version 0.1.8 release notes

  • updated test cases, integrated ngrok, travis-ci, codecov

Version 0.1.7 release notes

  • Updated test cases to use logs/ folder

Version 0.1.6 release notes

  • Added new github repo to package.json
  • Updated README with repo list

Version 0.1.5 release notes

  • Refined README

Version 0.1.4 release notes

  • Updated README to keep in sync with richmond.js core.

Version 0.1.3 release notes

  • Removed validation of param id (:id)
  • mongoose.Types.ObjectId.isValid(req.params.id) is rejecting valid ids
  • Bogus test also failed because it said an id of 'thisisabadid' was valid.

Version 0.1.2 release notes

  • Refactored internal logging.

Version 0.1.1 release notes

  • Updated repo url

Version 0.1.0 release notes

  • Initial release