-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #678 from ocsigen/static
Static linking without config file
- Loading branch information
Showing
22 changed files
with
306 additions
and
135 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
opam-version: "2.0" | ||
name: "ocsigen-start" | ||
version: "6.3.0" | ||
version: "7.0.0" | ||
authors: "[email protected]" | ||
maintainer: "[email protected]" | ||
synopsis: "Higher-level library for developing Web and mobile applications with users, registration, notifications, etc" | ||
|
@@ -23,7 +23,7 @@ depends: [ | |
"pgocaml_ppx" {>= "4.0"} | ||
"safepass" {>= "3.0"} | ||
"ocsigen-i18n" {>= "4.0.0"} | ||
"eliom" {>= "10.4.0" & < "11.0.0"} | ||
"eliom" {>= "11.0.0" & < "12.0.0"} | ||
"ocsigen-toolkit" {>= "2.7.0"} | ||
"ocsigen-ppx-rpc" | ||
"ocsigen-i18n" {>= "3.7.0"} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
opam-version: "2.0" | ||
name: "%%%PROJECT_NAME%%%" | ||
version: "0.1" | ||
synopsis: "Pseudo package for defining project dependencies" | ||
synopsis: "%%%PROJECT_NAME%%%" | ||
|
||
depends: [ | ||
"eliom" {>= "10.0.0" & < "11.0.0"} | ||
"ocsipersist-pgsql" {>= "1.0" & < "2.0"} | ||
"ocsigen-start" | ||
"eliom" {>= "11.0.0" & < "12.0.0"} | ||
"ocsipersist-pgsql-config" {>= "2.0" & < "3.0"} | ||
"ocsigen-start" {>= "7.0.0" & < "8.0.0"} | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
(** This is the main file if you are using static linking without config file. | ||
It is not used if you are using a config file and ocsigenserver *) | ||
|
||
module%shared %%%MODULE_NAME%%% = %%%MODULE_NAME%%% | ||
|
||
let%server _ = | ||
Ocsigen_server.start | ||
[ Ocsigen_server.host | ||
[Staticmod.run ~dir:"local/var/www/%%%PROJECT_NAME%%%" (); Eliom.run ()] ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
(* Set static configuration in case you are using static linking only. | ||
These information are taken from the config file otherwise. | ||
*) | ||
let%server set_static_config () = | ||
if not (Ocsigen_config.has_configuration_file ()) | ||
then begin | ||
Ocsigen_config.set_ports [`All, 8080]; | ||
Ocsigen_config.set_veryverbose (); | ||
Ocsigen_config.set_debugmode true; | ||
Ocsigen_config.set_logdir "local/var/log/%%%PROJECT_NAME%%%"; | ||
Ocsigen_config.set_datadir "local/var/data/%%%PROJECT_NAME%%%"; | ||
Ocsigen_config.set_uploaddir (Some "/tmp"); | ||
Ocsigen_config.set_usedefaulthostname true; | ||
Ocsigen_config.set_command_pipe "local/var/run/%%%PROJECT_NAME%%%-cmd"; | ||
Ocsigen_config.set_default_charset (Some "utf-8"); | ||
Ocsipersist_settings.set_host "%%PGHOST%%"; | ||
Ocsipersist_settings.set_port %%PGPORT%%; | ||
Ocsipersist_settings.set_database "ocsipersist_%%%PROJECT_NAME%%%"; | ||
Ocsipersist.init (); | ||
%%%MODULE_NAME%%%_config.os_db_database := Some "%%PGDATABASE%%"; | ||
%%%MODULE_NAME%%%_config.os_db_host := Some "%%PGHOST%%"; | ||
%%%MODULE_NAME%%%_config.os_db_user := | ||
(let u = "%%PGUSER%%" in if u = "" then None else Some u); | ||
%%%MODULE_NAME%%%_config.os_db_password := Some "%%PGPASSWORD%%"; | ||
%%%MODULE_NAME%%%_config.os_db_port := Some %%PGPORT%%; | ||
%%%MODULE_NAME%%%_config.app_name := | ||
Filename.chop_suffix | ||
(Unix.readlink "local/var/www/%%%PROJECT_NAME%%%/%%%PROJECT_NAME%%%.js") ".js" ; | ||
%%%MODULE_NAME%%%_config.css_name := | ||
Unix.readlink "local/var/www/%%%PROJECT_NAME%%%/css/%%%PROJECT_NAME%%%.css"; | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.