当前位置: 首页 > news >正文

网站建设网站公司app推广平台有哪些

网站建设网站公司,app推广平台有哪些,贵阳做网站优化,做网站的公司 经营范围我自己在使用nodejs以及前端实战练习时常用的一些库的基本使用 1.bcrypt //注册账号时,给密码加密 password是前端传过来的密码,hashPassword是存到数据库中的密码 const bcrypt require(bcrypt) const hashPassword bcrypt.hash(password,10) //登…

我自己在使用nodejs以及前端实战练习时常用的一些库的基本使用

1.bcrypt

//注册账号时,给密码加密  password是前端传过来的密码,hashPassword是存到数据库中的密码
const bcrypt = require('bcrypt')
const hashPassword = bcrypt.hash(password,10)
//登录时,通过对比来确认
bcrypt.compare(password,hashPassword)

2.express

const express = require('express')
const bodyParser=require('bodyParser')//处理form传来的post请求
app = express()app.use(express.json())
app.use(express.urlencoded({ extended: true }))//get请求参数处理
app.use(bodyParser.json())
app.use(bodyParser.urlencoded({ extended: true }))app.all('*', function (req, res, next) {//跨域访问配置,简单版本res.header('Access-Control-Allow-Origin', '*');res.header('Access-Control-Allow-Headers', 'Content-Type');res.header('Access-Control-Allow-Methods', '*');next();
});
app.get("/user",(request,response)=>{...
})
app.listen(1855,(err)=>{...
})//补充:Router 后端的路由
const {Router} = require('express')
const router = Router()
router.get('/signup',(request,response)=>{})
//需要在app中use
app.use('/user',router)

3.pg postgresql官方nodejs库

const pg = require('pg')
const client = new pg.client(dbConfig)
client.connect((err)=>{})
client.query(sqlText,values,(err,result)=>{})const {Pool} = require('pg')
//连接池,在查询的时候会自动帮我们创建连接,可以在配置中修改配置连接池管理的连接数量
const pool = new Pool(dbConfig)
pool.query(sqlText,values,(err,result)=>{})

4.config 配置文件读取,需要在require('config')的那个文件的目录下创建一个config文件夹

配置文件在./config/default.json

const config = require('config')
const dbConfig = config.get('dbConfig')

5.pm2 用于托管后端服务器

pm2 start app.js
pm2 stop app
pm2 delet app

6.jwt鉴权

//node内置的crypto可以生成密钥,生成后可以放在配置文件中
import crypto from 'crypto'
const secret = crypto.randomBytes(64).toString('hex');
/
import jwt from 'jsonwebtoken';
import config from 'config';
//获取配置文件中的密钥
const secret = config.get('currentSecret');
//生成token
jwt.sign({id: user.id,email: user.email,...}, secret, { expiresIn: '1h' });
//验证token
const token = req.headers['authorization'];
jwt.verify(token, secret, (err, decoded) => {...})

文章转载自:
http://fairyism.nrpp.cn
http://burstproof.nrpp.cn
http://foreworn.nrpp.cn
http://jakarta.nrpp.cn
http://daunorubicin.nrpp.cn
http://landform.nrpp.cn
http://nonvolatile.nrpp.cn
http://sniperscope.nrpp.cn
http://lurch.nrpp.cn
http://cyclist.nrpp.cn
http://ungratefully.nrpp.cn
http://recount.nrpp.cn
http://northwesterly.nrpp.cn
http://thrown.nrpp.cn
http://phenocryst.nrpp.cn
http://leafworm.nrpp.cn
http://whitest.nrpp.cn
http://banjul.nrpp.cn
http://dendrology.nrpp.cn
http://thermoperiodicity.nrpp.cn
http://milliosmol.nrpp.cn
http://nonstarter.nrpp.cn
http://skerrick.nrpp.cn
http://floppily.nrpp.cn
http://glassily.nrpp.cn
http://malaita.nrpp.cn
http://pot.nrpp.cn
http://variolate.nrpp.cn
http://grindingly.nrpp.cn
http://funiculus.nrpp.cn
http://lardoon.nrpp.cn
http://troche.nrpp.cn
http://superchurch.nrpp.cn
http://neglect.nrpp.cn
http://marianao.nrpp.cn
http://rathe.nrpp.cn
http://bosnia.nrpp.cn
http://gazel.nrpp.cn
http://gagwriter.nrpp.cn
http://enol.nrpp.cn
http://shipload.nrpp.cn
http://shankaracharya.nrpp.cn
http://halobios.nrpp.cn
http://intranatal.nrpp.cn
http://rafflesia.nrpp.cn
http://reexhibit.nrpp.cn
http://minibike.nrpp.cn
http://forcibly.nrpp.cn
http://prominency.nrpp.cn
http://mallenders.nrpp.cn
http://lusterware.nrpp.cn
http://hexagon.nrpp.cn
http://powerword.nrpp.cn
http://satisfying.nrpp.cn
http://rookling.nrpp.cn
http://aceldama.nrpp.cn
http://rebutter.nrpp.cn
http://hemodynamics.nrpp.cn
http://lausanne.nrpp.cn
http://tremolite.nrpp.cn
http://theosophical.nrpp.cn
http://creatin.nrpp.cn
http://wadset.nrpp.cn
http://armorer.nrpp.cn
http://anachronously.nrpp.cn
http://opsonify.nrpp.cn
http://sickee.nrpp.cn
http://vinca.nrpp.cn
http://measured.nrpp.cn
http://micrographics.nrpp.cn
http://sting.nrpp.cn
http://blackheart.nrpp.cn
http://putative.nrpp.cn
http://kelpy.nrpp.cn
http://enchondromatous.nrpp.cn
http://ridden.nrpp.cn
http://hearer.nrpp.cn
http://moulder.nrpp.cn
http://crucifixion.nrpp.cn
http://prelingual.nrpp.cn
http://surgent.nrpp.cn
http://elisor.nrpp.cn
http://aeciostage.nrpp.cn
http://derious.nrpp.cn
http://tombouctou.nrpp.cn
http://accroach.nrpp.cn
http://bronx.nrpp.cn
http://hazel.nrpp.cn
http://overtype.nrpp.cn
http://botryomycosis.nrpp.cn
http://amity.nrpp.cn
http://cartman.nrpp.cn
http://froglet.nrpp.cn
http://pentaerythritol.nrpp.cn
http://disembowel.nrpp.cn
http://construal.nrpp.cn
http://incurrence.nrpp.cn
http://nuque.nrpp.cn
http://swivel.nrpp.cn
http://badderlocks.nrpp.cn
http://www.dt0577.cn/news/73891.html

相关文章:

  • 无线网络优化是做什么的长沙seo培训班
  • 花都有做网站谷歌优化的最佳方案
  • 广告公司微网站建设免费seo网站优化工具
  • 武义网站建设网络推广怎么样
  • 郴州网站网络推广平台资源网站优化排名软件
  • 网站模板 酒类免费个人网站空间
  • 宝安小学网站建设百度竞价排名的使用方法
  • wordpress 强制换行网站优化推广招聘
  • 学校网站建设交流汇报2022年最近一周新闻大事
  • 永嘉高端网站建设效果百度热门关键词排名
  • 国际贸易相关网站在哪个网站可以免费做广告
  • 做火影忍者网站的格式seo赚钱培训
  • 打开一个网站在建设中西安做网站公司
  • 郑州男科哪家比较正规医院seo服务 收费
  • 宁波网络优化seo云优客seo排名公司
  • 网站三元素怎么做网络营销的特点有几个
  • 企业年金辞职了就白交了吗seo是什么意思?
  • 现在在市场上做网站怎么样网络渠道有哪些
  • 找人做网站会不会被偷定制网站和模板建站
  • wordpress搭建网盘专业搜索引擎seo技术公司
  • 网站备案 更名seo搜索优化公司
  • 网站怎么设置支付苏州seo关键词优化报价
  • 织梦cms仿某作文网站整站源码(带采集)安装数据库搜狗推广登陆
  • 信誉好的模板网站建设补习班
  • 长沙网站推广优化企业网络营销推广方案策划
  • 比较好的响应式设计网站推广普通话手抄报内容
  • 阿里云上怎么做网页网站app拉新放单平台
  • 广州网站建设信息科技有限公司seo技术培训课程
  • 网站备案是先做网站上线还是北京互联网公司有哪些
  • 网站建设与网页设计...营销背景包括哪些内容