Closed MathiasKrill closed 3 years ago
Hi @MathiasKrill, please check the app logs / terminal output. Is there some error?
Hi, i used the repo: i used is "https://github.com/totaljs/emptyproject-flow.git" version from same day. If you familar with docker, i did this in my docker file:
Steps to reproduce, Dockerfile:
FROM ubuntu:20.04
RUN apt-get update && DEBIAN_FRONTEND="noninteractive" TZ="Europe/London" apt-get install -y npm
RUN apt-get install -y build-essential
RUN apt install -y nodejs
RUN apt-get install -y git
WORKDIR /usr/src/app
RUN npm install total4
COPY package*.json ./
COPY . .
WORKDIR /usr/src/app/src/node_modules/
RUN git clone https://github.com/totaljs/emptyproject-flow.git
WORKDIR /usr/src/app/src/node_modules/emptyproject-flow/
CMD ["node","index.js"]
Build and start: docker build -t . total docker run -p 127.0.0.1:8000:8000 total
Enter in Browser http://127.0.0.1:8000/
Flow created: flow_20210426-0038.zip
The post-request i used:
curl --location --request POST 'http://127.0.0.1:8000/test1/' \
--header 'Content-Type: text/plain' \
--data-raw '{"message":"just a test"}'
Error: <!DOCTYPE html>
```
Hi @MathiasKrill,
sorry for delay. I have tested your Flow and everything works correctly. I saw your POST command and it's wrong because the Total.js framework can't process text/plain
data as data. You need to use raw
flag in the route or change your content-type to text/json
.
Thank you.
Hey no problem for the delay . Thank you for looking for it. Will there be a change in future for the text/plain flag as data ?. Thank you for pointing out that :-)
Thank you. No, no, you can use the raw
flag only because Total.js framework parses the request payload/body according to its content-type. So plain/text
can't be parsed because it's plain text. The raw
flag will return a buffer that you can convert easily to text controller.body.toString('utf8')
Hi, i have problems receiving any REST call with POST or GET. I tried HTTP Listener, Receiver, and Route but never get any reaction.
Thats for example the Route:
I use Postman to test-call:
http://127.0.0.1:8000/test1/
and get<title>400: Bad Request</title>
Do i need to add addional settings somewhere? Some mappings maybe?