From 2a873bc91aff220bc496c9c2fe1eb6308ebe40c3 Mon Sep 17 00:00:00 2001 From: DIYgod Date: Mon, 16 May 2016 19:24:33 +0800 Subject: [PATCH] use new api based on DaoCloud; rm useless modules --- demo/index.html | 2 +- nodejs/index.js | 5 ----- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/demo/index.html b/demo/index.html index 8372c02..d92f8f2 100644 --- a/demo/index.html +++ b/demo/index.html @@ -66,7 +66,7 @@ }, danmaku: { id: '9E2E3368B56CDBB4', - api: 'https://dan.anotherhome.net/' + api: 'http://dplayer.daoapp.io/' } }); dp.init(); diff --git a/nodejs/index.js b/nodejs/index.js index 4c06501..4a8e762 100644 --- a/nodejs/index.js +++ b/nodejs/index.js @@ -1,13 +1,9 @@ -var http = require('http'); var url = require('url'); -var util = require('util'); -var querystring = require('querystring'); var mongoose = require('mongoose'); var mongodbUrl = 'mongodb://' + process.env.MONGODB_USERNAME + ':' + process.env.MONGODB_PASSWORD + '@' + process.env.MONGODB_PORT_27017_TCP_ADDR + ':' + process.env.MONGODB_PORT_27017_TCP_PORT + '/' + process.env.MONGODB_INSTANCE_NAME; var express = require('express'); var app = express(); - var danmakuSchema = new mongoose.Schema({ player: String, author: String, @@ -69,7 +65,6 @@ app.post('/', function (req, res) { } catch (err) { jsonStr = null; } - // jsonStr ? res.send({"status":"success", "name": jsonStr.test}) : res.send({"status":"error"}); var dan = new danmaku({player: jsonStr.player, author: jsonStr.author, time: jsonStr.time, text: jsonStr.text, color: jsonStr.color, type: jsonStr.type}); dan.save(function (err, d) {