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

@cfl/simple-platform-server

v2.1.0

Published

Simple server for web apps using the CoreFiling True North Platform APIs.

Downloads

18

Readme

Simple Platform Server

Simple server for web apps using the CoreFiling True North Platform APIs.

The server can be configured with your OAuth 2 client ID and secret. It performs the OAuth 2 authorization code grant against the CoreFiling OAuth 2 server and maintains the bearer token needed for API access in the http session.

If no credentials are configured it defaults to the demonstration client.

All API requests made by the UI are proxied through this server which adds the token to the request.

Usage

To run the server you need an OAuth 2 client ID and secret for the CoreFiling Platform. The credentials for this are passed to the server via environment variables CLIENT_ID and CLIENT_SECRET.

Add this package as a dependency of your project:

yarn add @cfl/simple-platform-server

Then add it as a script in package.json:

"scripts": {
    …
    "start": "simple-platform-server --staticDir www -appName name-of-your-app"
}

And run the server with something like

$ export CLIENT_ID=YOUR_ID
$ export CLIENT_SECRET=YOUR_SECRET
$ yarn start

You can then visit your app at http://localhost:8080/name-of-your-app/. The first time you do it will redirect you to the CoreFiling platform login page. Once you are logged in the application should run normally.

Your app consists of HTML and JavaScript files in the --staticDir directory.

Customize the port number listened to by setting environment variable PORT or by adding a --port command-line option. Note that overriding the port will prevent login if the port no longer matches a registered redirect URI for the application. The default credentials support a redirect URI of 'http://localhost:8080/*' for testing.

Conventions

APIs are available with URLs starting with /api/name/v1/. For example, the base URL of the Document Service is http://localhost:8080/api/document-service/v1/.

Additional URLs recognised by the server are

  • /auth/logout to log the user out;
  • /api/user provides information about the currently logged-in user;
  • /api/apps provides information for the apps menu.

The last two are exceptions to the other API endpoints because they are supplied by the gateway itself, not a backend service.

Licence

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this software except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.