1const express = require("express");
2const bodyParser = require("body-parser");
3const cors = require("cors");
4
5const app = express();
6
7var corsOptions = {
8 origin: "http://localhost:8081"
9};
10
11app.use(cors(corsOptions));
12
13// parse requests of content-type - application/json
14app.use(bodyParser.json());
15
16// parse requests of content-type - application/x-www-form-urlencoded
17app.use(bodyParser.urlencoded({ extended: true }));
18
19// simple route
20app.get("/", (req, res) => {
21 res.json({ message: "Welcome to esparkinfo application." });
22});
23
24// set port, listen for requests
25const PORT = process.env.PORT || 8080;
26app.listen(PORT, () => {
27 console.log(`Server is running on port ${PORT}.`);
28});
1 @sequelize.AllowNull(false)
2 @sequelize.Column(DataTypes.JSON)
3 get personalInformation(): PersonalInformation {
4 return JSON.parse(this.getDataValue('personalInformation'))
5 }
6
7 set personalInformation(val: any) {
8 this.setDataValue('personalInformation', JSON.stringify(val))
9 }
10
11 @sequelize.AllowNull(false)
12 @sequelize.Column(DataTypes.JSON)
13 get workExperinces(): WorkExperince[] {
14 return JSON.parse(this.getDataValue('workExperinces'))
15 }
16
17 set workExperinces(val: any) {
18 this.setDataValue('workExperinces', JSON.stringify(val))
19 }