New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

bootstruct

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bootstruct

Routing by structure. A name-convention framework for Node.js.

  • 1.4.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
decreased by-66.67%
Maintainers
1
Weekly downloads
 
Created
Source

Bootstruct

Bootstruct is a web framework for Node, based on a folder-structure / file-name convention.

Routing by structure.

Table of contents

  • Overview (this page)
  • [Get Started](https://github.com/taitulism/Bootstruct/blob/master/Docs/Get Started.md)
  • Docs

Overview

Creating web apps with Node requires wiring up your routes manually: we need to bind different URLs to different handlers. We usually do that by coding. With Bootstruct we do it by creating files and folders.

The whole story happens in a single folder, the web-server's root folder (might ring some bells):

├── myProject
│   ├── node_modules
│   ├── server-index.js
│   └── www              <──

Bootstruct ties that folder with your host root (domain root, localhost or just / in common Nodish) and routes requests through that folder's structure, matching URLs to corresponding paths under that folder.

To support routes like:

domain.com/
domain.com/A
domain.com/A/B
domain.com/A/B/C

your web-root folder tree should look like:

├── www
│   └── A
│       └── B
│           └── C

Bootstruct leverages the parental folder chain (e.g. '/A/B/C') and provides you with an onion-like layered app.

A request to /A/B/C would go through:

1. www
2. www/A
3. www/A/B
4. www/A/B/C
5. www/A/B
6. www/A
7. www

Do you see the onion?

Requests start at the web-root folder (e.g. "www"), do their way into the target-folder, then go back out to the web-root folder and you can run some code on every step of the way.

Bootstruct:

  • saves you from coding your routes.
  • enforces a natural code separation by concept.
  • provides you with great control over request flow.
  • can be used alongside with express/connect.
  • is extendable.

Start Using Bootstruct


Questions, suggestions, criticism, bugs, hugs, typos and kudos are all welcome.

taitulism(at)gmail(dot)com

Keywords

FAQs

Package last updated on 17 Oct 2015

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