Skip to content

update documentation to mention that slurp-config uses classpath and not a relative path #1

@gdeer81

Description

@gdeer81

lets say you have a top level config folder with props.config in it
if you use plain old slurp like this (slurp "config/props.config") you'll get the contents of the file
but if you use (slurp-config "config/props.config") you'll get nil
Then you'll discover that slurp-config uses the classpath to find config files so you'll run'lein classpath' and see that your config directory is not in your classpath.
so you'll add :resource-paths ["config"] to your project.clj
you verify the config folder is now in your classpath, but slurp-config still returns nil
so you drop the folder name and just use (slurp-config "props.config") and it

If only the documentation had mentioned this

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions