Socket
Socket
Sign inDemoInstall

@allegiant/sessions

Package Overview
Dependencies
3
Maintainers
2
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @allegiant/sessions

Simple sessions module for the allegiant app framework.


Version published
Weekly downloads
3
increased by50%
Maintainers
2
Install size
33.0 kB
Created
Weekly downloads
 

Readme

Source

sessions

Simple sessions module for the allegiant app framework.

There be 🐲 here! The API and functionality are being cemented, anything before a 1.0.0 release is subject to change.

Npm Version Build Status Coverage Status

Installation

npm install @allegiant/sessions --save

Usage

const App = require('@allegiant/core');

let server = App.create("https://localhost:7000", { 
    '@allegiant/sessions': {
        enabled: true,
        path: path.resolve(path.join(process.cwd(), 'sessions')),
        autogen: true
    }
});
server.get('/', function() {
    if (!this.session.data.firstTimeServed) {
      this.session.data.firstTimeServed = new Date()
    }
    this.content = `<h1>It just works! You first looked at this content on ${this.session.data.firstTimeServed}</h1>`;
    return 200;
})
.start();

Copyright © 2017 Allegiant. Distributed under the terms of the MIT License, see LICENSE

Availble via npm or github.

FAQs

Last updated on 02 Jan 2018

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc