Coder Social home page Coder Social logo

安全退出http服务 about cinatra HOT 10 CLOSED

qicosmos avatar qicosmos commented on July 29, 2024
安全退出http服务

from cinatra.

Comments (10)

qicosmos avatar qicosmos commented on July 29, 2024 1

我需要这个功能啊,对于你们这些强迫症患者我真是没办法了。你今天去掉了,明天有人要求加上,那咋办?

from cinatra.

fawdlstty avatar fawdlstty commented on July 29, 2024

场景是一个后台服务,但需要根据需求动态启动、停止http服务;目前做法是CreateProcess、ExitProcess来控制服务开启及停止

from cinatra.

fawdlstty avatar fawdlstty commented on July 29, 2024

另外启动服务后自动在当前文件夹下面新建了public/static目录,win7 x86环境,vs2017

from cinatra.

qicosmos avatar qicosmos commented on July 29, 2024

关于服务端退出,可以通过命令行控制,while读输入,然后根据输入的字符串去退出,这个自己做一下就行了,有stop接口,至于你说的run once是支持的,可以看之前的一个pr。

创建目录是需要的,用来放需要下载的资源文件,如果没有创建目录会自动去创建。

from cinatra.

fawdlstty avatar fawdlstty commented on July 29, 2024

噢看跳了,run_one是支持。我这边只是做简单的http处理,不需要用到静态资源的上传及下载,只在启动进程的时候,目录就创建了,逻辑上感觉不合适

from cinatra.

qicosmos avatar qicosmos commented on July 29, 2024

当初是怕用户忘记设置目录了,确实容易忘记,然后又去上传下载,会遇到错误,自动创建是确保不会漏掉。主要是出于方便用户使用角度考虑的。多创建的文件夹对你来说用不到也不会有副作用,实在不想看到自己删掉就好了。

from cinatra.

fawdlstty avatar fawdlstty commented on July 29, 2024

能否提pr去掉这功能呢?在需要的时候再创建,不需要的时候不自动创建目录

from cinatra.

qicosmos avatar qicosmos commented on July 29, 2024

或者你增加一个设置项目,默认是创建,不设置也会创建,只有显式设置不创建才不创建,这样可以。

from cinatra.

fawdlstty avatar fawdlstty commented on July 29, 2024

😅那就显式指定不创建吧

from cinatra.

qicosmos avatar qicosmos commented on July 29, 2024

from cinatra.

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.