0

How to or what's the best way to run (not call with curl) a REST API service using purely shell commands or scripts?

I would typically run APIs with Python using FastAPI, however, I was wondering if it is possible to do it in a less-Pythonic and more-Linux way.

4
  • I'd suggest a "more Linux way" is to use python. Use the best tool for the job. Commented Dec 29, 2021 at 14:22
  • 1
    Do you mean you want to setup a web server by using purely shell commands or scripts? Commented Dec 30, 2021 at 2:08
  • 1
    On SO, see Minimal web server using netcat. You could also see the related Q&A's over at Unix & Linux, such as this Simple command line HTTP server and this Simple server that triggers script and responds. I would say though that since you're comparing it with FastAPI, ... you might not get the same set of functionalities/features with purely shell commands/scripts. Commented Dec 30, 2021 at 2:14
  • thnx @GinoMempin that's exactly what I was looking for. I wanted to setup a web server (API) that, on being called, triggers another script and then sends an API response with the output of that other script. With Python I guess I would have to do it through calling a sub process, and so I wanted to it more with pure shell. Commented Dec 30, 2021 at 8:56

1 Answer 1

0

Sampo is most likely what you're looking for.

Written in bash, it is a shell script API server you can run directly in your terminal or via container on Kubernetes.

It exposes endpoints which could trigger different actions, running a script among others.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.