-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
5,265 additions
and
854 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,18 @@ | ||
<<<<<<< HEAD | ||
.vscode/ | ||
build/ | ||
typings/ | ||
node_modules/ | ||
.DS* | ||
._.* | ||
.idea/ | ||
yarn.lock | ||
yarn.lock | ||
#Build folder | ||
build/ | ||
|
||
#Modules folder | ||
node_modules/ | ||
|
||
#Logs files | ||
yarn-error.log | ||
|
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,32 +1,8 @@ | ||
### Modern Express | Easy starter project for writing modern Express MongoDb Applications using TypeScript and Webpack | ||
### Ts Node Server | ||
|
||
This project is used to quickly get started with Webpack using Express, MongoDb, Webpack and TypeScript. The intention of this project is to learn to use Webpack with out getting bogged down in the details of configuring Webpack. Below is a list of the outcomes of this project. | ||
Start the dev server "yarn run server:dev:nodemon" | ||
Build application watch "yarn run build" | ||
Compiled start server "yarn run compiled" | ||
Clean all build "yarn run clean" | ||
|
||
1. Automates the task of setting up Webpack | ||
2. Cleanly installs and setups Webpack with out polluting the global system scope | ||
3. Creates basic Express project to write TypeScript | ||
4. Cleanly builds TypeScript code into a build directory | ||
5. Stores and Saves Typings for VSCode | ||
6. Uses `ejs` as the templating engine | ||
|
||
**Setup** | ||
--- | ||
**[Clone this Repository](https://github.com/lossless1/nodets-webpack-starter/archive/master.zip)** | ||
|
||
``` | ||
yarn install | ||
``` | ||
|
||
**Run Builds** | ||
--- | ||
``` | ||
yarn run build | ||
``` | ||
|
||
**Run Application** | ||
--- | ||
``` | ||
yarn start | ||
mongod | ||
``` | ||
Simple start server "yarn start" |
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 @@ | ||
console.log('Hello worldd'); |
This file was deleted.
Oops, something went wrong.
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,14 @@ | ||
{ | ||
"port": 1337, | ||
"security": { | ||
"tokenLife": 3600 | ||
}, | ||
"mongodb": { | ||
"protocol":"mongodb", | ||
"host":"localhost", | ||
"port":"27017", | ||
"user":"name", | ||
"db":"test", | ||
"uri": "mongodb://localhost:27017/test" | ||
} | ||
} |
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,25 @@ | ||
var MongoClient = require('mongodb').MongoClient | ||
, assert = require('assert'); | ||
|
||
// Connection URL | ||
var url = 'mongodb://localhost:27017/myproject'; | ||
// Use connect method to connect to the Server | ||
MongoClient.connect(url,{ useNewUrlParser: false } , function(err, db) { | ||
assert.equal(null, err); | ||
console.log("Connected correctly to server"); | ||
console.log(db); | ||
|
||
// Insert a single document | ||
db.collection('inserts').insertOne({ | ||
a:1 | ||
, b: function() { return 'hello'; } | ||
}, { | ||
w: 'majority' | ||
, wtimeout: 10000 | ||
, serializeFunctions: true | ||
}, function(err, r) { | ||
assert.equal(null, err); | ||
assert.equal(1, r.insertedCount); | ||
db.close(); | ||
}); | ||
}); |
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,16 @@ | ||
{ | ||
"verbose": true, | ||
"ignore": ["*.test.js", "fixtures/*", "**/*.spec.ts"], | ||
"execMap": { | ||
"echo": "1", | ||
"ts": "./node_modules/.bin/ts-node bin/www.ts", | ||
"rb": "ruby", | ||
"pde": "processing --sketch={{pwd}} --run" | ||
}, | ||
"watch": [ | ||
"**/*" | ||
], | ||
"env": { | ||
"NODE_ENV": "development" | ||
} | ||
} |
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,5 @@ | ||
import * as nconf from 'nconf'; | ||
|
||
nconf.argv().env().file({ | ||
file: './config.json' | ||
file: './config/config.json' | ||
}) | ||
export { nconf }; |
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
File renamed without changes.
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
Oops, something went wrong.