New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

ex

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ex

A razor-sharp DSL for express inspired by Zappa.

latest
Source
npmnpm
Version
0.1.4
Version published
Maintainers
1
Created
Source

Introduction

A razor-sharp DSL for express inspired by Zappa.

Install

npm install ex

Usage

Ex binds this to useful things and provides a few utility methods which are helpful. The simple ex app is probably:

require('ex') ->
  @get '/', ->
    @send 'hello world'

  @run()

The default express app could be rewritten like so:

ex = require 'ex'

ex ->
  # all environments
  @set 'port', process.env.PORT or 3000
  @set 'views', __dirname + '/views'
  @set 'view engine', 'jade'
  @use ex.favicon()
  @use ex.logger 'dev'
  @use ex.bodyParser()
  @use ex.methodOverride()
  @use @app.router
  @use ex.static __dirname + '/public'

  # development only
  @development ->
    @use ex.errorHandler()

  @get '/', ->
    @render 'index', title: 'Ex'

  @run =>
    console.log 'Ex listening on port ' + @get 'port'

Keywords

dsl

FAQs

Package last updated on 20 Nov 2013

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