How to crash my Node app on purpose?

后端 未结 4 598
无人及你
无人及你 2020-12-30 20:27

I\'ve been working on a deployment work flow with Dokku and Docker and now I want to take care of continuity of my app (along the lines of Forever). To test it, I need a way

4条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-30 21:01

    And adding to DrakaSAN's answer, an even simpler C module to crash:

    int main()
    {
        *(int*)(0) = 0;
        return -1;
    }
    

    Even shorter ones are available on this page. If you don't want it to be too hard to read, you can probably go with

    int main()
    {
        int i=1/0;
    }
    

提交回复
热议问题