flow icon indicating copy to clipboard operation
flow copied to clipboard

FlowV4 If you add a controller, Route doesn't work.

Open KangGeunSu opened this issue 5 years ago • 11 comments

I am making a login page using Auth.

If you add default.js to the controller, httproute.js does not work.

This is my file structure. image

what's the problem?

KangGeunSu avatar Apr 05 '21 06:04 KangGeunSu

Please check...

KangGeunSu avatar May 07 '21 11:05 KangGeunSu

Hi, we have updated HttpRoute component.

Update:

  • Update Total.js framework
  • Flow package
  • HttpRoute component

I belive that it will work.

petersirka avatar May 07 '21 11:05 petersirka

All of them have been tested with the latest version.

But it doesn't work yet.

There is no 'isUNIQUE' attribute under 'F.routes.web'.

[ { path: '/',
    hash: 0,
    id: null,
    apiname: undefined,
    name: '',
    priority: 0,
    sitemap: '',
    schema: undefined,
    novalidate: false,
    workflow: undefined,
    subdomain: null,
    description: undefined,
    controller: 'unknown',
    owner: 'package_flow',
    urlraw: '/',
    url: [ '/' ],
    param: [],
    paramidindex: -1,
    paramnames: null,
    paramtypes: null,
    flags: [ 'get' ],
    flags2: { get: true },
    method: 'GET',
    execute: [Function],
    length: 10240,
    middleware: null,
    timeout: 3000,
    isGET: true,
    isMULTIPLE: false,
    isJSON: false,
    isXML: false,
    isRAW: false,
    isENCRYPT: false,
    isMOBILE: false,
    isROBOT: false,
    isMOBILE_VARY: false,
    MEMBER: 0,
    isWILDCARD: false,
    isROLE: false,
    isREFERER: false,
    isHTTPS: false,
    isHTTP: false,
    isDEBUG: false,
    isRELEASE: false,
    isBOTH: true,
    isXHR: false,
    isUPLOAD: false,
    isSYSTEM: false,
    isPARAM: false,
    isDELAY: false,
    isDYNAMICSCHEMA: false,
    isAPI: false,
    CUSTOM: null,
    options: undefined,
    type: 'web',
    parent: { route: [Circular] },
    compare: [Function],
    isUNIQUE: true,
    currentViewDirectory: '' },
  { path: '/login',
    hash: 1448719514,
    id: null,
    apiname: undefined,
    name: '/login',
    priority: 0,
    sitemap: '',
    schema: undefined,
    novalidate: false,
    workflow: undefined,
    subdomain: null,
    description: undefined,
    controller: 'default',
    owner: 'controller_default',
    urlraw: '/login/',
    url: [ 'login' ],
    param: [],
    paramidindex: -1,
    paramnames: null,
    paramtypes: null,
    flags: [ 'get' ],
    flags2: { get: true },
    method: 'GET',
    execute: [Function: view_login],
    length: 10240,
    middleware: null,
    timeout: 3000,
    isGET: true,
    isMULTIPLE: false,
    isJSON: false,
    isXML: false,
    isRAW: false,
    isENCRYPT: false,
    isMOBILE: false,
    isROBOT: false,
    isMOBILE_VARY: false,
    MEMBER: 0,
    isWILDCARD: false,
    isROLE: false,
    isREFERER: false,
    isHTTPS: false,
    isHTTP: false,
    isDEBUG: false,
    isRELEASE: false,
    isBOTH: true,
    isXHR: false,
    isUPLOAD: false,
    isSYSTEM: false,
    isPARAM: false,
    isDELAY: false,
    isDYNAMICSCHEMA: false,
    isAPI: false,
    CUSTOM: null,
    options: undefined,
    type: 'web',
    parent: { route: [Circular] },
    compare: [Function],
    isUNIQUE: true },
  { path: 'GET /test 5000,id:1620609715122',
    hash: 46961985,
    id: '1620609715122',
    apiname: undefined,
    name: '/test',
    priority: 0,
    sitemap: '',
    schema: undefined,
    novalidate: false,
    workflow: undefined,
    subdomain: null,
    description: undefined,
    controller: 'default',
    owner: 'controller_default',
    urlraw: '/test/',
    url: [ 'test' ],
    param: [],
    paramidindex: -1,
    paramnames: null,
    paramtypes: null,
    flags: [ 'get' ],
    flags2: { get: true },
    method: 'GET',
    execute: [Function: handler],
    length: 5120,
    middleware: null,
    timeout: 5000,
    isGET: true,
    isMULTIPLE: false,
    isJSON: false,
    isXML: false,
    isRAW: false,
    isENCRYPT: false,
    isMOBILE: false,
    isROBOT: false,
    isMOBILE_VARY: false,
    MEMBER: 0,
    isWILDCARD: false,
    isROLE: false,
    isREFERER: false,
    isHTTPS: false,
    isHTTP: false,
    isDEBUG: false,
    isRELEASE: false,
    isBOTH: true,
    isXHR: false,
    isUPLOAD: false,
    isSYSTEM: false,
    isPARAM: false,
    isDELAY: false,
    isDYNAMICSCHEMA: false,
    isAPI: false,
    CUSTOM: null,
    options: undefined,
    type: 'web',
    parent: { route: [Circular] },
    compare: [Function] } ]

/ : flow (action 200 OK) /login : controllers/default.js (action 200 OK) /test : flow's httproute (not action 404..)

KangGeunSu avatar May 10 '21 01:05 KangGeunSu

Can you send me a simple Flow project with that route and all node_modules? I'll test it.

petersirka avatar May 10 '21 05:05 petersirka

emptyproject-flow.zip

Download "emptyproject-flow", add httproute, and add controller.

KangGeunSu avatar May 10 '21 08:05 KangGeunSu

If controllers/default.js is deleted, it works normally.

/test flow's httproute (action 200 OK)

If you add default.js to the controller, httproute.js does not work.

KangGeunSu avatar May 10 '21 08:05 KangGeunSu

Yes, I found a bug in Total.js framework. I have fixed it, can you test it on your side? $ npm install total4@beta. This week will be a new official release. Thank you for the report!

petersirka avatar May 10 '21 10:05 petersirka

An error occurs

Cannot find module 'worker_threads'

my node -v v10.24.0

Thank you

KangGeunSu avatar May 10 '21 11:05 KangGeunSu

Hmm, Total.js 4 needs Node.js +14. But it will work with +12 and worker threads are part of Node.js v12.

petersirka avatar May 10 '21 11:05 petersirka

OK I'll try.

KangGeunSu avatar May 10 '21 11:05 KangGeunSu

Confirmed Thank You!!

KangGeunSu avatar May 11 '21 00:05 KangGeunSu