Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const express = require("express");
- const app = express();
- const bodyParser = require('body-parser');
- const sql = require('mysql');
- app.use(bodyParser.json());
- app.use(bodyParser.urlencoded({extended: true}));
- app.use(express.json());
- app.use(express.urlencoded());
- app.use(express.static("static"));
- app.listen(8080, () => console.log("Listening on port 8080"));
- var connection = sql.createConnection({
- host: 'localhost',
- user: 'root',
- password: 'password',
- database: 'userDB',
- });
- connection.connect(function(err){
- if(err) throw err;
- console.log("connected to DB.");
- });
Add Comment
Please, Sign In to add comment