mirror of https://github.com/PiyushXCoder/lupt.git
changes
This commit is contained in:
parent
7ddec9e47f
commit
b924c4abf2
|
|
@ -0,0 +1,12 @@
|
|||
.PHONY: build deploy
|
||||
|
||||
help: ## Show this help.
|
||||
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {sub("\\\\n",sprintf("\n%22c"," "), $$2);printf "\033[36m%-20s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)
|
||||
|
||||
build: ## Build static binary and put it in the functions directory.
|
||||
@cargo build --release
|
||||
@mkdir -p functions
|
||||
@cp target/release/lupt functions
|
||||
|
||||
deploy: build ## Deploy the site using Netlify's CLI
|
||||
@netlify deploy --prod
|
||||
20
netlify.toml
20
netlify.toml
|
|
@ -1,20 +1,4 @@
|
|||
# example netlify.toml
|
||||
[build]
|
||||
command = "cargo build --release"
|
||||
command = "make build"
|
||||
publish = "static"
|
||||
functions = "functions"
|
||||
|
||||
## Uncomment to use this redirect for Single Page Applications like create-react-app.
|
||||
## Not needed for static site generators.
|
||||
#[[redirects]]
|
||||
# from = "/*"
|
||||
# to = "/index.html"
|
||||
# status = 200
|
||||
|
||||
## (optional) Settings for Netlify Dev
|
||||
## https://github.com/netlify/cli/blob/master/docs/netlify-dev.md#project-detection
|
||||
#[dev]
|
||||
# command = "yarn start" # Command to start your dev server
|
||||
# port = 3000 # Port that the dev server will be listening on
|
||||
# publish = "dist" # Folder with the static content for _redirect file
|
||||
|
||||
## more info on configuring this file: https://www.netlify.com/docs/netlify-toml-reference/
|
||||
|
|
|
|||
|
|
@ -7,6 +7,16 @@ pub struct Config {
|
|||
|
||||
impl Config {
|
||||
pub fn new() -> Self {
|
||||
let bind_address = std::env::var("URL");
|
||||
let static_path = std::env::var("STATIC_PATH");
|
||||
|
||||
if bind_address.is_ok() && static_path.is_ok() {
|
||||
return Config {
|
||||
static_path: static_path.unwrap(),
|
||||
bind_address: bind_address.unwrap()
|
||||
};
|
||||
}
|
||||
|
||||
let matches = App::new("Lupt (लुप्त)")
|
||||
.version(env!("CARGO_PKG_VERSION"))
|
||||
.author(env!("CARGO_PKG_AUTHORS"))
|
||||
|
|
|
|||
Loading…
Reference in New Issue