Ver código fonte

Initial Commit

Matt Coles 9 anos atrás
commit
272fa26135
3 arquivos alterados com 40 adições e 0 exclusões
  1. 1 0
      .gitignore
  2. 22 0
      index.js
  3. 17 0
      package.json

+ 1 - 0
.gitignore

@@ -0,0 +1 @@
1
+node_modules/

+ 22 - 0
index.js

@@ -0,0 +1,22 @@
1
+var express = require('express');
2
+var app = express();
3
+var bcrypt = require('bcrypt-nodejs');
4
+var Redis = require('ioredis');
5
+var redis = new Redis();
6
+
7
+app.get('/hello/(:name)?', function (req, res) {
8
+    var name = req.params.name || "World";
9
+    res.send('Hello ' + name + "!");
10
+});
11
+
12
+app.post('/register', function(req, res) {
13
+
14
+});
15
+
16
+app.post('/login', function(req, res) {
17
+
18
+});
19
+
20
+app.listen(3000, function () {
21
+    console.log('Example app listening on port 3000!');
22
+});

+ 17 - 0
package.json

@@ -0,0 +1,17 @@
1
+{
2
+  "name": "ip-project-server",
3
+  "version": "1.0.0",
4
+  "description": "Server for the IP project",
5
+  "main": "index.js",
6
+  "scripts": {
7
+    "test": "node index.js"
8
+  },
9
+  "author": "Matt",
10
+  "license": "MIT",
11
+  "dependencies": {
12
+    "bcrypt-nodejs": "0.0.3",
13
+    "body-parser": "^1.15.0",
14
+    "express": "^4.13.4",
15
+    "ioredis": "^1.15.1"
16
+  }
17
+}