This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TABLE `post` ( | |
`pid` bigint(20) NOT NULL AUTO_INCREMENT, | |
`userid` bigint(20) NOT NULL, | |
`title` varchar(1000) NOT NULL, | |
`slug` varchar(1000) NOT NULL, | |
`content` longtext NOT NULL, | |
`metadesc` mediumtext NOT NULL, | |
`category` varchar(700) NOT NULL, | |
`image` varchar(700) NOT NULL, | |
`createdat` date NOT NULL, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from flask import Flask | |
app = Flask(__name__) | |
@app.route('/') | |
def demo(): | |
return 'its working' | |
if __name__ == '__main__': | |
app.run() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var express = require('express'); | |
var bodyParser = require('body-parser'); | |
var fs = require('fs'); | |
var app = express(); | |
app.set('view engine','ejs'); | |
app.use(bodyParser.urlencoded({extended:true,limit:'50mb',parameterLimit:50000})); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<meta http-equiv="X-UA-Compatible" content="ie=edge"> | |
<title>Document</title> | |
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css"> | |
</head> | |
<body> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "ajax", | |
"version": "1.0.0", | |
"description": "", | |
"main": "index.js", | |
"scripts": { | |
"test": "echo \"Error: no test specified\" && exit 1", | |
"start": "node app.js" | |
}, | |
"keywords": [], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var express = require('express'); | |
var mongoose = require('mongoose'); | |
var bodyParser = require('body-parser'); | |
var path = require('path'); | |
var $ = require('jquery'); | |
//connect to db | |
mongoose.connect('mongodb://localhost:27017/ajaxdemo',{useNewUrlParser:true}) | |
.then(()=>console.log('connected to db')) | |
.catch((err)=>console.log('connection error',err)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).ready(function(){ | |
alert('application started'); | |
getdata(); | |
$('.addbtn').click(function(){ | |
var task = $("#task").val(); | |
$.ajax({ | |
url:'/task/addtask', | |
method:'post', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<meta http-equiv="X-UA-Compatible" content="ie=edge"> | |
<title>Document</title> | |
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css"> | |
<script src="/jquery/jquery.js"></script> | |
</head> | |
<body> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var express = require('express'); | |
var taskModel = require('../models/task'); | |
var router = express.Router(); | |
router.get('/home',(req,res)=>{ | |
res.render('demo'); | |
}); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var mongoose = require('mongoose'); | |
var taskSchema = new mongoose.Schema({ | |
task:{ | |
type:String | |
} | |
}); | |
var taskModel = module.exports = mongoose.model('task',taskSchema); | |
NewerOlder