Skip to content

mockacino supports status codes via config file#2

Open
grzegorzleszek wants to merge 2 commits intomichaelarmstrong:masterfrom
grzegorzleszek:status_code
Open

mockacino supports status codes via config file#2
grzegorzleszek wants to merge 2 commits intomichaelarmstrong:masterfrom
grzegorzleszek:status_code

Conversation

@grzegorzleszek
Copy link
Copy Markdown

let me know what u think ;)

mockacino.rb Outdated
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good, i guess only 2 things i'd change, rename the default config to config.conf or config.txt just so that people's text editors automatically will support it.

Also, right now it only supports hard coding a status code in there right? it'd be better if it was key value pair based file so its extensible in the future.

So instead of the contents being just '404' for example, the contents could be statusCode = '404' or similar... That way we can expand it in the future without breaking old features.

What do you think ?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds great.
Now it is key value based, so example config.conf will be :
status, 204

Config file name is "config.conf";
config file is key value pair based, eg:

status, 204
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants