Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

isite

Package Overview
Dependencies
Maintainers
1
Versions
359
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

isite

Fast & Easy Full Web Site Management

  • 1.0.6
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
41
decreased by-92.88%
Maintainers
1
Weekly downloads
 
Created
Source

Features

    - Auto Routes [simple & Advanced]  
    - Handle Response Headers  
    - Auto Configer Request Cookies & Query Strings  
    - Detect User Session  
    - Auto Caching Files  
    - MD5 Hash Function  

Installation

npm install isite --save

Using

var isite = require('isite')
var site = isite() // default port 80

site.run()

Advanced Using

var isite = require('isite')
var site = isite({
    port:8080 , 
    dir:__dirname + '/site_files'
    })

site.run()

Routes

Easy Site Routing

site.addRoute({name: '/js/jquery.js',path:  './js/jquery.min.js'});
site.addRoute({name: '/js/bootstrap.js',path:  './js/bootstrap.min.js'});
site.addRoute({name: '/css/bootstrap.css',path:  './css/bootstrap.min.css'});
site.addRoute({name: '/',path:  './index.html'});

Advanced Site Routing

site.addRoute({
    name: '/',
    callback: function (req, res) {
        res.setHeader('Content-type', 'text/html');
        res.writeHead(200);
        site.html('index', function (err, content) {
            res.end(content);
        });
    }
});

site.addRoute({
    name: '/api',
    method: 'POST',
    callback: function (req, res) {
        res.setHeader('Content-type', 'application/json');
        res.writeHead(200);
        site.json('index', function (err, content) {
            res.end(content);
        });
    }
});

Sessions

site.get('/login', function(req, res) {
    req.session.set('username', 'amr barakat')
    res.end('loged ok !! ')
})

site.get('/userInfo', function(req, res) {
    var userName = req.session.get('username')
    res.end(userName)
})

More

Email : Absunstar@gmail.com Github : https://github.com/absunstar/ Linkedin : https://www.linkedin.com/in/absunstar/

FAQs

Package last updated on 20 Jul 2017

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc