You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

@serverful/views

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@serverful/views

A resource selector extension for the Serverful core

0.0.3
latest
Source
npmnpm
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

Serverful/Views

An extension for selecting cached views.

Features

  • View selection, render and request end.
  • A reloadable view cache.
  • Automatic header inserts on load.
  • Predefined handler configurations.
  • Documentations
  • Github

Installation

npm install @serverful/views

const Views = require("@serverful/views");
// ...

Usage

Register the plugin and configure the view directory.

Serverful.Extension(Views(Content, Headers?));

Insertion of predefined headers.

// Headers/Navbar.html
<div>
    <a href="#">Home</a>
    <a href="#">Github</a>
</div>

// Views/Index.html
<serverful navbar>

Handle a request using by selecting a view.

MyServer.Incoming(Packet => {
    // Information processing...
    Packet.Request.View("/internal/embed");
});

This module is licensed under Apache 2.0.

FAQs

Package last updated on 11 Mar 2021

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