View 20200729005825-create-user.js
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
'use strict'; | |
module.exports = { | |
up: async (queryInterface, Sequelize) => { | |
await queryInterface.createTable('Users', { | |
id: { | |
allowNull: false, | |
autoIncrement: true, | |
primaryKey: true, | |
type: Sequelize.INTEGER | |
}, |
View post.js
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
'use strict'; | |
const { | |
Model | |
} = require('sequelize'); | |
module.exports = (sequelize, DataTypes) => { | |
class Post extends Model { | |
/** | |
* Helper method for defining associations. | |
* This method is not a part of Sequelize lifecycle. | |
* The `models/index` file will call this method automatically. |
View tag.js
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
'use strict'; | |
const { | |
Model | |
} = require('sequelize'); | |
module.exports = (sequelize, DataTypes) => { | |
class Tag extends Model { | |
/** | |
* Helper method for defining associations. | |
* This method is not a part of Sequelize lifecycle. | |
* The `models/index` file will call this method automatically. |
View posttag.js
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
'use strict'; | |
const { | |
Model | |
} = require('sequelize'); | |
module.exports = (sequelize, DataTypes) => { | |
class PostTag extends Model { | |
/** | |
* Helper method for defining associations. | |
* This method is not a part of Sequelize lifecycle. | |
* The `models/index` file will call this method automatically. |
View 20200729131649-demo-users.js
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
'use strict'; | |
const fake = require('faker'); | |
module.exports = { | |
up: async (queryInterface, Sequelize) => { | |
let users = []; | |
for(let i=0; i<=100; i++){ | |
users.push({ | |
name: fake.name.firstName(), | |
email:fake.internet.email(), | |
createdAt:new Date(), |
View 20200729133702-demo-post.js
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
'use strict'; | |
const fake = require('faker'); | |
module.exports = { | |
up: async (queryInterface, Sequelize) => { | |
let users = await queryInterface.sequelize.query( | |
`SELECT id from Users;` | |
); | |
let posts = []; | |
for(let i=0; i<=100; i++){ |
View userRoutes.js
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
const express = require('express'); | |
const userController = require('../controllers/userController'); | |
const route = express.Router(); | |
route.post('/user', userController.newUser); | |
module.exports = route; |
View home.js
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
console.log('Testing something') |
View index.php
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
<?php | |
$menu = new Menu(); | |
if($text == "" && $isUserRegistered == true){ | |
//user is registered and string is is empty | |
echo "CON " . $menu->mainMenuRegistered("<Add a name here>"); | |
}else if($text == "" && $isUserRegistered== false){ | |
//user is unregistered and string is is empty | |
$menu->mainMenuUnRegistered(); | |
}else if($isUserRegistered== false){ | |
//user is unregistered and string is not empty |
View index.js
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
const express = require('express'); | |
const routes = require('./routes/userRoutes'); | |
const Parser = require('body-parser'); | |
const app = express(); | |
app.use(Parser.urlencoded({extended:true})); | |
app.use(routes); | |
app.listen(process.env.API_PORT); |
OlderNewer