Search code examples
yamlmojito

How to use YML files for a Mojito project?


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)


Solution

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