我使用以下命令删除了https://+:443/条目:
const express = require('express'),
app = express(),
bodyParser = require('body-parser'),
mongoose = require('mongoose'),
jwt = require('jsonwebtoken'),
bcrypt = require('bcrypt'),
config = require('./config'),
User = require('./models/user');
//MongoDb configuration
mongoose.connect(config.db, { useNewUrlParser: true }, function(err){
if(err){
console.log(err);
} else {
console.log('Mongo is here for you!');
}
});
//BodyParser configuration
app.use(bodyParser.urlencoded({ extended: false }));
app.use(bodyParser.json());
//Routes
app.get('/', function(req, res){
res.json({
"message": "Welcome to the Node express api!"
});
});
//SignUp
app.post('/signup', function(req, res) {
var hashedPassword = bcrypt.hashSync(req.body.password, 8);
User.create({
email : req.body.email,
password : hashedPassword
},
function (err, user) {
if (err) return res.status(500).send("There was a problem registering the user.")
// create a token
var token = jwt.sign({ id: user._id }, config.secret, {
expiresIn: config.tokenTime // expires in
});
res.status(200).send({ auth: true, token: token });
});
});
//Show all users
app.get('/users', function(req, res) {
User.find({}, function(err, users) {
res.json(users);
});
});
// SERVERHOST
app.listen(3000, function(){
console.log('Node api server has started! :)');
});
但是现在当我想使用以下命令重新创建它时:
const mongoose = require('mongoose');
const user = mongoose.Schema({
email: {
type: String,
required: true
},
password: {
type: String,
required: true
}
});
module.exports = mongoose.model('User', user);
我有以下错误:
netsh http delete urlacl https://+:443/
但是该条目不存在:
netsh http add urlacl url=http://+:443/ user="tout le monde"
在那里需要一些帮助,因为我真的很坚持。