Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Static assets #76

Merged
merged 5 commits into from
Aug 19, 2017
Merged

Static assets #76

merged 5 commits into from
Aug 19, 2017

Conversation

PaulMaddox
Copy link
Contributor

Implements new --static-dir CLI flag that defaults to public/.

Fixes #41

@@ -66,6 +67,11 @@ func main() {
Usage: "Optional logfile to send runtime logs to",
},
cli.StringFlag{
Name: "static-dir, s",
Usage: "Any static assets (e.g. CSS/Javascript/HTML) files located in this directory will be presented at /",
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you eloborate what / refers to? Something like "mounted at / of API gateway URL"

Copy link
Contributor

@sanathkr sanathkr left a comment

Choose a reason for hiding this comment

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

Minor comments. Feel free to ignore if you think it is not necessary.


// Mount static files
if c.String("static-dir") != "" {
public, err := getWorkingDir(baseDir, c.String("static-dir"), checkWorkingDirExist)
Copy link
Contributor

Choose a reason for hiding this comment

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

rename public variable to static for consistency

log.Printf("WARNING: Could not mount static files: %s\n", err)
} else {
fmt.Fprintf(os.Stderr, "Mounting static files from %s at /\n", public)
router.PathPrefix("/").Handler(http.FileServer(http.Dir(public)))
Copy link
Contributor

Choose a reason for hiding this comment

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

people might ask for a static path prefix override real soon.

@sanathkr
Copy link
Contributor

Merging this now to cut a new release.

@sanathkr sanathkr merged commit 269b612 into aws:develop Aug 19, 2017
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.

3 participants