0

It is said that Mojito can use JSON or YML as the application.json (the config file), but I haven't seen YML examples around?

For example, how to convert:

[
    {
        "settings": [ "master" ],
        "specs": {
            "hello" : {
                "type" : "HelloWorldMojit"
            }
        }
    }
]

to a YML file?

Also, when we use

$ mojito create app Hello

can't we specify that we want YML files as the default (instead of JSON files)?


Details:

I used npm's yamljs to convert the file to:

-
  settings: [master]
  specs: { hello: { type: HelloWorldMojit } }

and it doesn't work. And I edited it to

-
  settings: [master]
  specs:
      hello:
          type:
              HelloWorldMojit

It won't work either. The server can start, but when the homepage was accessed, the error is:

error: (outputhandler.server): { [Error: Cannot expand instance [hello], 
       or instance.controller is undefined] code: 500 }

(the file routes.json is depending on hello being defined)

j0k
  • 22,600
  • 28
  • 79
  • 90
nonopolarity
  • 146,324
  • 131
  • 460
  • 740

2 Answers2

0

As of Mojito 0.5.2, YML is supported again. 0.5.1 and 0.5.0 do not support it.

nonopolarity
  • 146,324
  • 131
  • 460
  • 740
0

We don't have archetypes with yaml, you will have to transform the files manually and renaming them. The good news, a more flexible archetypes infrastructure is on the making.

You should be ok with that configuration you pasted in the question, just use the latest version of mojito (0.5.x)

Andrew Barber
  • 39,603
  • 20
  • 94
  • 123
caridy
  • 244
  • 2
  • 5
  • j0k isn't actually the one who posted the question; he just edited it. 動靜能量 is the one who posted the question. – Andrew Barber Mar 11 '13 at 17:39