Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

change require() method to import for ES6,7 support #233

Merged
merged 4 commits into from
May 23, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion server/database.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ function printLog(data) {
console.log(lines.join(''));
}

const spawn = require('child_process').spawn;
import {spawn} from 'child_process';

const prc = spawn('mongod', ['--config', '../database/mongod.cfg']);

Expand Down
4 changes: 2 additions & 2 deletions server/https_server/https_server.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

const fs = require('fs');
const https = require('https');
import fs from 'fs';
import https from 'https';

/**
* Run https server
Expand Down
4 changes: 2 additions & 2 deletions server/https_server/redirect_server.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

const express = require('express');
const http = require('http');
import express from 'express';
import http from 'http';

/**
* Redirect http to https
Expand Down
12 changes: 6 additions & 6 deletions server/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

const express = require('express');
const path = require('path');
const bodyParser = require('body-parser');
import express from 'express';
import path from 'path';
import bodyParser from 'body-parser';

const config = require('./config');
const httpsServer = require('./https_server/https_server');
const redirectServer = require('./https_server/redirect_server');
import config from './config';
import httpsServer from './https_server/https_server';
import redirectServer from './https_server/redirect_server';

const app = express();

Expand Down