Browse Source

Added installation instructions for Windows OS

Aman Kapoor 6 years ago
parent
commit
63e9010168
1 changed files with 56 additions and 3 deletions
  1. 56
    3
      Readme.md

+ 56
- 3
Readme.md View File

@@ -4,12 +4,10 @@
4 4
 
5 5
 A basic, barebones web app, intented to be used as a starting point for developing an [Isomorphic Go](http://isomorphicgo.org) application.
6 6
 
7
-## Installation
7
+## Installation on Unix-like OS
8 8
 
9 9
 The instructions assume that you are using a Unix-like operating system (e.g. BSD, Linux, Mac OS, etc).
10 10
 
11
-If you are using Windows, you may need to adapt the installation instructions, most notably for setting up the `ISOGO_APP_ROOT` environment variable.
12
-
13 11
 ### Prerequisites
14 12
 
15 13
 It is assumed that the latest version of Go is already installed on your system and that you have properly configured your Go workspace.
@@ -41,6 +39,61 @@ The web server runs locally on port 8080: [localhost:8080](http://localhost:8080
41 39
 If all goes well, you should see the Isomorphic Go logo, along with a message rendered on the web page.
42 40
 
43 41
 
42
+## Installation on Windows OS
43
+
44
+### Prerequisites
45
+
46
+It is assumed that the latest version of Go is already installed on your system and that you have properly configured your Go workspace. Make sure that GOPATH, GOROOT and GOBIN are set up. GOROOT and GOPATH were set up during the installation and configuration of Golang. To set up GOBIN, you have to edit environment variables.
47
+
48
+Open the envrionment variables window and,
49
+
50
+1. Find a variable called 'Path' under User Variables section. Focus on it and click 'Edit'. A new pop-up would open and there you would find a button called New in the top-right corner. Click on it, and it will bring blinking cursor in the focus. The cursor will be placed at the end of the list of paths. So if your Go workplace is C:\GoWorkspace, then you would type 'C:\GoWorkspace\bin' there.
51
+
52
+2. In the 'System Variables' section, click on New. Enter 'GOBIN' in the Variable Name field and, 'C:\GoWorkspace\bin\' in the Variable value field.
53
+
54
+We have assumed that your go workspace is called GoWorkspace and is located at C:\GoWorkspace. It is highly possible that your go workspace's name is not same as the example taken here, please modify the name of your go workspace according to your configuration.
55
+
56
+Save the changes made and run 'go env' from cmd. You should now see GOBIN to be pointing to bin directory inside your Go workspace folder.
57
+
58
+### Get the isogoapp project
59
+Enter the command `go get -u github.com/isomorphicgo/isogoapp` in cmd.
60
+
61
+If Go is properly configured in your system and command is successfully executed, then you will see the following directory structure in src folder of your Go workspace.
62
+
63
+C:\Workspace\src\github.com\isomorphicgo\isogoapp
64
+
65
+### Define the `ISOGO_APP_ROOT` environment variable.
66
+Now, we again need to set up an environment variable. Open the environment variable screen and under System Variables section, create a New variable. On Windows 10, this is done by clicking on New.
67
+
68
+In the Variable name field, enter 'ISOGO_APP_ROOT'.
69
+
70
+And, in the Variable value field, enter `%GOPATH%src\github.com\isomorphicgo\isogoapp`
71
+
72
+Did you notice back-slash missing between %GOPATH% and src? It is not a typo. If your GOPATH has a trailing back-slash in it, then type the command as given above. And if it does not have back-slash, then enter `%GOPATH%\src\github.com\isomorphicgo\isogoapp`. Check this detail by typing 'go env' in cmd.
73
+
74
+### Build the Client-Side Go App
75
+
76
+Now close all the instances of cmd relevant to our work as they don't know about the environment variable changes that have been made. 
77
+
78
+Open a new cmd window. And run this command `cd %ISOGO_APP_ROOT%/client`.
79
+
80
+You would now be pointed to the client folder inside isogoapp folder.
81
+
82
+Now run `go get ./...` command. And after its successful execution, run `gopherjs build` command. 
83
+
84
+Make sure that you don't move away from client directory during the execution of all these three commands.
85
+
86
+### Run the Web Server Instance
87
+
88
+Now, open a new cmd windows and run `cd %ISOGO_APP_ROOT%`.
89
+
90
+After this change of directory, run `go run isogoapp.go`.
91
+
92
+The web server runs locally on port 8080: [localhost:8080](http://localhost:8080).
93
+
94
+If all goes well, you should see the Isomorphic Go logo, along with a message rendered on the web page, when you visit the link above.
95
+
96
+
44 97
 ## Where to now?
45 98
 
46 99
 ### Kick