Skip to content

Commit

Permalink
헤로쿠 테스트
Browse files Browse the repository at this point in the history
  • Loading branch information
yumjuice committed Jul 16, 2020
1 parent 6f8c397 commit 456f3f0
Show file tree
Hide file tree
Showing 133 changed files with 19,485 additions and 4 deletions.
27 changes: 27 additions & 0 deletions api/users.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,31 @@ router.post('/', function(req,res,next){
});
});


// 로그인한 유저정보 가져오기
router.get('/',auth,function(req,res,next){

var userId=req.decoded.userId;

getConnection((conn)=>{
var sql = "SELECT * FROM user WHERE id=?"
conn.query(
sql, // excute sql
[userId], // ? <- value
function(err, result){
if(err){
console.error(err);
res.json(util.successFalse(err));
throw err;
}
else {

res.json(util.successTrue(null,'유저 정보'))
}
})
conn.release();
});
});


module.exports = router;
13 changes: 10 additions & 3 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ var bodyParser = require('body-parser');
const app = express();
const port = 3000;

app.set('views', path.join(__dirname, 'views')); // ejs file location
app.set('view engine', 'ejs'); //select view templet engine


// Middlewares
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({extended: true}));
Expand All @@ -17,10 +21,13 @@ app.use(function (req, res, next) {
});



app.get('/', function(req, res){
res.render('signup');
})

// API
app.use('/users', require('./api/users'));
app.use('/auth', require('./api/auth'));
//app.use('/users', require('./api/users'));
//app.use('/auth', require('./api/auth'));

// Server
app.listen(port, function(){
Expand Down
1 change: 0 additions & 1 deletion main.html

This file was deleted.

15 changes: 15 additions & 0 deletions node_modules/.bin/ejs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions node_modules/.bin/ejs.cmd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions node_modules/.bin/ejs.ps1

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions node_modules/.bin/jake

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions node_modules/.bin/jake.cmd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 18 additions & 0 deletions node_modules/.bin/jake.ps1

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

165 changes: 165 additions & 0 deletions node_modules/ansi-styles/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions node_modules/ansi-styles/license

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 456f3f0

Please sign in to comment.