Skip to content

u/indescription

In this archive from Jun 2008 to Apr 2026

9
posts
172
comments
3
media
570
score

Thank you for your input. It seems that if I don't specify a port and try to use the standard ports it wont run because those ports are already in use by the normal web server.

Basically, these frameworks are using the built in php web server, but I want to just use the web server I already have configured.

the reverse proxy idea is viable, but seems to make this more complex than it needs to be.

1 points

Hello! I have been exploring framework options for a dead simple API so I wanted something as basic as possible. However, I've come across these workerman and swoole based frameworks where you need to initiate them from the command line and specify a port.

This means you end up developing at localhost:3030/api (or whatever you specify)

What I dont understand is how this works when you go into production and dont want to specify a random port beyond 80/443.

Is it possible to get these frameworks to work as normal web apps?

1 points

That is a good idea, thank you. I haven't considered DI for this, but that might be a good approach.

Basically there is a .json file that holds route configuration. Here is a sample with 2 routes:

 "about" : {
    "path": "/about/",
    "method": "GET",
    "controller": "content"
  },
  "reservations" : {
    "path": "/reservations/",
    "method": "GET",
    "controller": {
      "name": "content",
      "options": {
        "1": {
          "data": {
            "source": "{{app.data.source}}pages/reservations/default.json"
          }
        },
        "2": {
          "data": {
            "source": "{{app.hostname}}reservations/locations/data/",
            "returnAs": "locations"
          }
        }
      }
    }
  }   

Not every route will be complex or require extra options for the controller. So I was simply looking for a way to test for the presence of the deep config option and apply its settings if needed.

1 points

Keyboard shortcuts

Move and act

jork
Next / previous post or comment
Enteroro
Open the post
f
Open the media viewer
s
Save
h
Hide (the toast has Undo)
Tab
Right after an action: the toast's Undo
x
Collapse the comment
v
Next layout: cards, compact, grid

Go to

/
Search
gthenh
Home
gthena
All
gthens
Subreddits
gthenl
Library
?
This list
Esc
Close a menu or this list

In the viewer

←or→
Previous / next file
↑or↓
Previous / next post
korj
Previous / next post
Space
Play / pause
m
Mute
z
Zoom
s
Save
o
Open the post (on its own page: back to it)
Esc
Close

Keys do nothing while you type in a box.