|
4 | 4 |
|
5 | 5 | This sample implements a complete Node.js application.
|
6 | 6 | Notable features:
|
7 |
| -- Typed usage of express for server side MVC |
8 |
| -- Typed usage of mongodb for server side database |
9 |
| -- Typed usage of Node.js |
10 |
| -- Use of TypeScript module syntax |
11 |
| -- Visual Studio project file for working with the project |
| 7 | + |
| 8 | +* Typed usage of express for server side MVC |
| 9 | +* Typed usage of mongodb for server side database |
| 10 | +* Typed usage of Node.js |
| 11 | +* Use of external typings from DefinitelyTyped |
| 12 | +* Visual Studio project file for working with the project |
12 | 13 |
|
13 | 14 | ## Running
|
14 | 15 |
|
15 | 16 | Note: Perform steps 3 - 6 with your working directory set to the folder containing this README:
|
16 | 17 |
|
17 | 18 | 1. Install MongoDB if necessary (see http://docs.mongodb.org/manual/installation/ )
|
18 | 19 |
|
19 |
| -2. Run the following command to launch the MongoDB process: |
20 |
| -`<mongoinstalldir>\bin\mongod` |
| 20 | +2. Ensure you have a clean directory to dedicate as to a database (e.g. `C:\imageboard` or `~/imageboard/`). |
| 21 | + |
| 22 | +3. From *this repository's imageboard directory*, run the following command to launch the MongoDB process. |
| 23 | + ```shell |
| 24 | + <MONGO_INSTALL_DIRECTORY>/bin/mongod --dbpath <PATH_TO_DB_DIRECTORY> |
| 25 | + ``` |
21 | 26 |
|
22 |
| -3. Restore the sample app data to MongoDB in another command prompt with the following command: |
23 |
| -`<mongoinstalldir>\bin\mongorestore dump` |
| 27 | +4. From *this repository's imageboard directory*, restore the sample app data to MongoDB in another command prompt with the following command: |
| 28 | + ```shell |
| 29 | + <MONGO_INSTALL_DIRECTORY>/bin/mongorestore dump |
| 30 | + ``` |
24 | 31 |
|
25 |
| -4. Install the app's node dependencies with the following command: |
26 |
| -`npm install` |
| 32 | +5. From this imageboard directory, install the app's node dependencies with the following command: |
| 33 | + ```shell |
| 34 | + npm install |
| 35 | + ``` |
27 | 36 |
|
28 |
| -5. Compile the app with the following command: |
29 |
| -`tsc --sourcemap --module commonjs app.ts` |
| 37 | +6. Compile the app with the following command: |
| 38 | + ```shell |
| 39 | + tsc --sourcemap --module commonjs app.ts |
| 40 | + ``` |
30 | 41 |
|
31 |
| -6. Launch the Node process to serve the app using the following command: |
32 |
| -`node app.js` |
| 42 | +7. Launch the Node process to serve the app using the following command: |
| 43 | + ```shell |
| 44 | + node app.js |
| 45 | + ``` |
33 | 46 |
|
34 |
| -7. Open your favorite browser and going to the following URL to access the app: |
35 |
| -`http://localhost:3000/` |
| 47 | +7. Open your favorite browser and navigating to `http://localhost:3000/` to access the app. |
0 commit comments