Signup data is reaching the server code
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
const express = require('express');
|
||||
const router = express.Router();
|
||||
|
||||
//basic account management
|
||||
router.post('/signup', require('./signup'));
|
||||
|
||||
module.exports = router;
|
||||
@@ -0,0 +1,16 @@
|
||||
//libraries
|
||||
const util = require('util');
|
||||
const bcrypt = require('bcryptjs');
|
||||
const sendmail = require('sendmail')({silent: true});
|
||||
|
||||
//utilities
|
||||
const validateEmail = require('../../common/utilities/validate-email.js');
|
||||
const validateUsername = require('../../common/utilities/validate-username.js');
|
||||
|
||||
//api/accounts/signup
|
||||
const route = (req, res) => {
|
||||
res.status(200).send("The server has received your information.");
|
||||
}
|
||||
|
||||
module.exports = route;
|
||||
|
||||
+10
-4
@@ -4,20 +4,26 @@ require('dotenv').config();
|
||||
//create the server
|
||||
const express = require('express');
|
||||
const app = express();
|
||||
const http = require('http').Server(app);
|
||||
const server = require('http').Server(app);
|
||||
|
||||
//libraries used here
|
||||
const path = require('path');
|
||||
const formidable = require('express-formidable');
|
||||
|
||||
app.use(formidable());
|
||||
|
||||
//account management
|
||||
app.use('/api/accounts', require('./accounts'));
|
||||
|
||||
//send static files
|
||||
app.use('/', express.static(path.resolve(__dirname, '../public')));
|
||||
app.use('/', express.static(path.resolve('../public')));
|
||||
|
||||
//fallback to the index file
|
||||
app.get('*', (req, res) => {
|
||||
res.sendFile(path.resolve(__dirname, `../public/index.html`));
|
||||
res.sendFile(path.resolve(`../public/index.html`));
|
||||
});
|
||||
|
||||
//startup
|
||||
http.listen(process.env.WEB_PORT || 3000, (err) => {
|
||||
server.listen(process.env.WEB_PORT || 3000, (err) => {
|
||||
console.log(`listening to localhost:${process.env.WEB_PORT || 3000}`);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user