• This project
    • Loading...
  • Sign in

fe / yohoblk-wap · Files

Go to a project

GitLab

  • Go to group
  • Project
  • Activity
  • Files
  • Commits
  • Pipelines 0
  • Builds 0
  • Graphs
  • Milestones
  • Issues 0
  • Merge Requests 0
  • Members
  • Labels
  • Wiki
  • Forks
  • Network
  • Create a new issue
  • yohoblk-wap
  • doraemon
  • middleware
  • devtools.js
  • 修改开发环境配置到test2
    48cd266c
    by 李奇
    2017-11-28 10:42:30 +0800  
    Browse Files
devtools.js 352 Bytes
Raw Blame History Permalink
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
'use strict';

const fs = require('fs');
let devHost = 'm.yohoblk.com';

fs.readFile('.devhost', (err, buf)=> {
    if (!err) {
        devHost = JSON.parse(buf.toString()).host;
    }
});

module.exports = () => {
    return (req, res, next) => {
        Object.assign(res.locals, {
            devHost: devHost
        });

        next();
    };
};