How to use the send.mime.default_type function in send

To help you get started, we’ve selected a few send examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github spirit-js / spirit / src / router / response-map.js View on Github external
/*
 * ResponseMap & related functions
 * ResponseMap is for making response maps
 * with chainable helper functions
 */

const core_response = require("../core/response")
const mime = require("send").mime
mime.default_type = undefined

class ResponseMap {
  constructor(body) {
    this.status = 200
    this.headers = {}
    this.body = body || ""
  }

  statusCode(n) {
    this.status = parseInt(n)
    return this
  }

  type(content_type) {
    let t = mime.lookup(content_type)
    if (!t) {

send

Better streaming static file server with Range and conditional-GET support

MIT
Latest version published 3 months ago

Package Health Score

89 / 100
Full package analysis