Skip to content

Windows Configuration

Cooper Filby edited this page Oct 9, 2017 · 1 revision

Configuration

Begin by logging in as the SparkEd User you created.

Allow Firewall traffic

  1. Click on Start
  2. Type Firewall and open windows firewall
  3. Create a new rule to allow TCP traffic to the port you intend to IIS to run SparkEd on (Ex: 80/443).

Clone Repository

  1. Open Command Prompt, make sure you are in the root directory or the directory where you want to contain the application.
  2. Create new directory: mkdir SparkEd
  3. Cd into the directory: cd SparkEd
  4. Clone the git repository: git clone <repository_link_here>

Perform Demeteorizer on Application / Build Application

  1. Open Command Prompt as administrator
  2. Run demeteorizer on application: demeteorizer -o <path_to_repo>
    If you encounter an error that Cannot find the module meteor.js:
    • Go to C:\Users\<username>\AppData\Roaming\npm and rename meteor and meteor.cmd to old.meteor and old.meteor.cmd
    • Run demeteorizer -o c:\SparkEd\manoap again
      If you encounter an error saying You are not in a Meteor project directory
    • Run meteor install in the application directory
    • Run demeteorizer -o c:\SparkEd\manoap
  3. Cd into the server directory of the application: cd <path_to_repo>\bundle\programs\server
  4. Install npm: npm install

Setup the application in IIS Manager

  1. Go to start
  2. Type in IIS
  3. Select Internet Information Services (IIS) Manager
  4. Collapse the Server name then collapse sites, make sure you have the Default Site, if not, create it
  5. Right Click on Sites then Add New Site
  6. Enter the site name
  7. Set the Physical Path to the site root directory
  8. Set Port to the desired open Port
  9. Click ok, the site should be start automatically, if not, start the site.
  10. Test to see if it is working by searching in your browser for: http://localhost:<port_number>

Create a web.config file in the root of the application directory

  1. Open Command Prompt
  2. Cd to the root directory of the application
  3. Run: touch web.config
  4. Open the file using Notepad++ or your preferred text editor
  5. Edit the web.config file to look like the following
<configuration>
    <appSettings>
        <add key="MONGO_URL" value="mongodb://<user_name>:<password>@localhost:27017/<db_name>" />
        <add key="ROOT_URL" value="http://<domain_name>" />
    </appSettings>
    <system.webServer>
        <handlers>
            <add name="iisnode" path="bundle/main.js" verb="*" modules="iisnode" />
        </handlers>
        <rewrite>
            <rules>
                <rule name="SparkEd">
                    <match url="/*" />
                    <action type="Rewrite" url="bundle/main.js" />
                </rule>
            </rules>
        </rewrite>
    </system.webServer>
</configuration>

Finally, verify that the application is running by navigating to http://localhost:<port_number> in your browser.