GithubHelp home page GithubHelp logo

How can I use it with pm2? about micro HOT 7 CLOSED

vercel avatar vercel commented on May 13, 2024
How can I use it with pm2?

from micro.

Comments (7)

ash0080 avatar ash0080 commented on May 13, 2024 15

OK, I got it work

// app.js
module.exports = async (req, res) => {
  res.end('welcome to Micro')
}

For CLI

then

// runner.js
const micro = require('micro')
const index = require('./app.js')

const server = micro(index)
server.listen(3000)

For PM2

from micro.

amio avatar amio commented on May 13, 2024 10

@arden Create a start.js:

import micro from 'micro'
import index from './index.js'

micro(index)

then:

pm2 start.js --name 'xxx'

from micro.

leo avatar leo commented on May 13, 2024 4

@arden Could you please convert this issue to english? 😄

from micro.

AbeEstrada avatar AbeEstrada commented on May 13, 2024 4

For future reference, this runs npm start:

pm2 start npm --name "xxx" -- start

from micro.

bnjmnt4n avatar bnjmnt4n commented on May 13, 2024

@leo basically the question is how to use it together with pm2.

from micro.

timneutkens avatar timneutkens commented on May 13, 2024

@amio that's awesome 😄 should document that use case 👍

from micro.

ash0080 avatar ash0080 commented on May 13, 2024

Not work now, any updates?
I know I can run micro programmatically then use PM2, but can't test it with micro-dev sametime

from micro.

Related Issues (20)

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.