-
Notifications
You must be signed in to change notification settings - Fork 3
Blog System Development
LittleSecretary edited this page Jun 13, 2018
·
3 revisions
A blog system demo based on ulord open platform on nodejs middle layer, express framework and paython back-end. address: http://blogs.ulord.one:10583/blog/#
Go to nodejs official website to download the corresponding system installation package, the version is greater than 8.0, and follow the prompts to install.
Verify successful installation.
$ node -v
Install python2.7.14,which can be downloaded on the officia website.
$ git clone https://github.com/UlordChain/ulord-blog-demo.git
cd ulord-blog-demo/js/ulord-blog
npm install
1.Clone ulord platform SDK Project and Install
git clone https://github.com/UlordChain/py-ulord-api.git
cd py-ulord-api
python setup.py install
cd ulord-blog-demo/python
python junior.py
cd ulord-blog-demo/js/ulord-blog
npm start
Enter localhost:3000 in the browser to see the blog
In Nodejs environment,you can user the request.js library to make http requests For example,call the login interface
var options = {
url: '127.0.0.1:5000/user/#', //# request
method: 'POST',
json: true,
headers: {
"content-type": "application/json",
},
body: {
username: username,
password: userpass,
}
}
request(options, function(error, response, data) {
...
})
In html,take login request through ajax
$.ajax({
async: false,
url: '127.0.0.1:5000/user/#', //# request
type: 'POST',
dataType: "json",
contentType: 'application/json',
success: function(res) {
...
}
})