Code Monkey home page Code Monkey logo

Comments (12)

atian25 avatar atian25 commented on May 18, 2024

就是一个 shell,其他的该怎么加它就怎么加,没啥区别

from eggjs-note.

mei2015 avatar mei2015 commented on May 18, 2024

我用的 node-window 但是。。

from eggjs-note.

mei2015 avatar mei2015 commented on May 18, 2024

[图片]这个 地方的 script 怎么配置啊

from eggjs-note.

mei2015 avatar mei2015 commented on May 18, 2024

https://blog.csdn.net/zzwwjjdj1/article/details/73483631

from eggjs-note.

atian25 avatar atian25 commented on May 18, 2024

直接指向 node_modules/.bin/egg-scripts 或者自己写个 js 来 fork npm start

from eggjs-note.

mei2015 avatar mei2015 commented on May 18, 2024

他是这样的 start: egg-script ...
主要是node-windows script 怎么写啊

from eggjs-note.

mei2015 avatar mei2015 commented on May 18, 2024

直接指向 node_modules/.bin/egg-scripts 或者自己写个 js 来 fork npm start

大大 能给我 列子 不 刚接触 这块 不太明白 现在 要用

from eggjs-note.

chenshenhai avatar chenshenhai commented on May 18, 2024

@mei2015 您好,你提出的问题很有意思,我一开始在学习egg.js时候也是第一反应在找怎用npm run start去启动。

因为egg.js本身对启动脚本做了封装,所以从初始化的脚手架是看不出传统Node应用npm run start的逻辑。

这里我之前写过一个最小demo, https://github.com/chenshenhai/eggjs-note/blob/master/demo/002-complete/index.js 使用egg 的node_module 替换里面的lib/egg,就可以直接用npm run start使用egg.js的核心服务能力。

from eggjs-note.

chenshenhai avatar chenshenhai commented on May 18, 2024

@atian25 惊现天猪大大,哈哈,很惭愧没时间把这本开源书写完 o(╯□╰)o

from eggjs-note.

atian25 avatar atian25 commented on May 18, 2024

不用那么复杂,就是写个 dispatch.js

// dispatch.js
const Command = require('egg-scripts');
new Command([
  'start', '--port=7001',
]).start();

from eggjs-note.

mei2015 avatar mei2015 commented on May 18, 2024

@mei2015 您好,你提出的问题很有意思,我一开始在学习egg.js时候也是第一反应在找怎用npm run start去启动。

因为egg.js本身对启动脚本做了封装,所以从初始化的脚手架是看不出传统Node应用npm run start的逻辑。

这里我之前写过一个最小demo, https://github.com/chenshenhai/eggjs-note/blob/master/demo/002-complete/index.js 使用egg 的node_module 替换里面的lib/egg,就可以直接用npm run start使用egg.js的核心服务能力。

这个我知道 我是像加入到系统服务器 我用node-window 解决的

from eggjs-note.

mei2015 avatar mei2015 commented on May 18, 2024

不用那么复杂,就是写个 dispatch.js

// dispatch.js
const Command = require('egg-scripts');
new Command([
  'start', '--port=7001',
]).start();

嗯 谢谢了 我解决了 还是用的 node-windows

from eggjs-note.

Related Issues (11)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.