Deploying on (middleware?)

I am running a dev server instance with at

After building the app (npx frontity build) I get a server.js file which has to be used as middleware by to render the final result.

I am getting a 502 Bad gateway error, probably because I am missing something setting the YAML files to get server.js as a middleware.

server.js is in place

Does anyone have experience with setting up middleware on (using workers or adding a third party library)?

beside this, the project is perfectly working in local

here is the file as a reference:

name: app
type: 'nodejs:14'
            build: |
        npx frontity build
        start: npx frontity serve
                        root: 'build'
disk: 512