-
首先启动一个Git Bash窗口(非Windows用户直接打开终端)
-
执行:
cd ~/.ssh
如果返回“… No such file or directory”,说明没有生成过SSH Key,直接进入第4步。否则进入第3步备份!
| { | |
| "version": "0.1.7", | |
| "notes": "", | |
| "pub_date": "2023-08-02T03:11:25.878Z", | |
| "platforms": { | |
| "darwin-x86_64": { | |
| "signature": "dW50cnVzdGVkIGNvbW1lbnQ6IHNpZ25hdHVyZSBmcm9tIHRhdXJpIHNlY3JldCBrZXkKUlVSMThyUloxUEVjcUF5OE9scUFIdnZTUFRZd1phK2JROXpwQloxU01iamZQdzNPcUFkRDZUbHgyenAzeEwrSmdybGVmcG03RGxSOERPMXJyUStMNkp1NjBzS2MvTFNDSGdjPQp0cnVzdGVkIGNvbW1lbnQ6IHRpbWVzdGFtcDoxNjkwOTQ1NzEwCWZpbGU6TGV0dHVyYS5hcHAudGFyLmd6CmpXYTdMa09lWGhwZFZjcHRJZWg2Q3BQOWlSTzhibTJHOUt5NlRzRzB2WUlrSHBML0tpNEJOaUFGdWdRaEwvM0dra0h3TndXUnovdFZ3ZlZHbDZpdkNBPT0K", | |
| "url": "https://github.com/zhanglun/lettura/releases/latest/download/Lettura_x64.app.tar.gz" | |
| }, | |
| "darwin-aarch64": { |
| function debounce (fn, wait, imediate) { | |
| let timer = null; | |
| return function (...args) { | |
| clearTimeout(timer); | |
| if (imediate && !timer) { | |
| fn.apply(this.args); | |
| } |
| let wrapPromiseWithAbort = function (promise) { | |
| let _abort = null | |
| let pAbort = new Promise ((resolve, reject) => { | |
| _abort = function (reason = 'abort!') { | |
| console.warn(reason) | |
| rej(reason) | |
| } | |
| }) | |
| let race = Promise.rece([promise, pAbort]) |
###Creating a REST API using Node.js, Express, and MongoDB
####Installing Node.js
Go to http://nodejs.org, and click the Install button. Run the installer that you just downloaded. When the installer completes, a message indicates that Node was installed at /usr/local/bin/node and npm was installed at /usr/local/bin/npm. At this point node.js is ready to use. Let’s implement the webserver application from the nodejs.org home page. We will use it as a starting point for our project: a RESTful API to access data (retrieve, create, update, delete) in a wine cellar database.
Create a folder named nodecellar anywhere on your file system. In the wincellar folder, create a file named server.js.
| //index.js | |
| var express = require('express'), | |
| app = module.exports = express.createServer(), | |
| mongoose = require('mongoose'); | |
| mongoose.connect('mongodb://localhost/nodeAuth'); | |
| //configure app | |
| app.configure(function() { | |
| app.set('views', __dirname + '/views'); |
| /* jQuery Tiny Pub/Sub - v0.7 - 10/27/2011 | |
| * http://benalman.com/ | |
| * Copyright (c) 2011 "Cowboy" Ben Alman; Licensed MIT, GPL */ | |
| (function($) { | |
| var o = $({}); | |
| $.subscribe = function() { | |
| o.on.apply(o, arguments); |
| (function() { | |
| //一个储存路径的哈希表 | |
| var routes = {}; | |
| //路径注册函数 | |
| function route(path, templateurl, controller) { | |
| routes[path] = { | |
| templateurl: templateurl, | |
| controller: controller | |
| }; |
var Person = Backbone.Model.extend();UUID(版本4)的形式为:
xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx
其中,x 是任意十六进制字符,y 是 8,9,a,b,A,B 其中之一。它的正则表 达式可以写作:
/[a-f0-9]{8}-[a-f0-9]{4}-4[a-f0-9]{3}-[89aAbB][a-f0-9]{3}-[a-f0-9]{12}/