FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

replace '"' to '' for the tutorial path of windows by fssh · Pull Request #86 · javascript-tutorial/server · GitHub

Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .js  (1) .json  (1) All 2 file types selected
Only manifest files
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
34 changes: 17 additions & 17 deletions modules/config/index.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -35,34 +35,34 @@ let config = module.exports = {
host: env.HOST || 'localhost'
},

appKeys: [secret.sessionKey],
appKeys: [secret.sessionKey],
adminKey: secret.adminKey,

certDir: path.join(secret.dir, 'cert'),
lang: lang,

lang: lang,

plnkrAuthId: secret.plnkrAuthId,

assetVersioning: env.ASSET_VERSIONING === 'file' ? 'file' :
env.ASSET_VERSIONING === 'query' ? 'query' : null,
env.ASSET_VERSIONING === 'query' ? 'query' : null,

pug: {
pug: {
basedir: path.join(process.cwd(), 'templates'),
cache: env.NODE_ENV !== 'development'
cache: env.NODE_ENV !== 'development'
},

supportEmail: 'iliakan@javascript.info',

projectRoot: process.cwd(),
projectRoot: process.cwd(),
// public files, served by nginx
publicRoot: path.join(process.cwd(), 'public', lang),
publicRoot: path.join(process.cwd(), 'public', lang),
// private files, for expiring links, not directly accessible
tutorialRoot: env.TUTORIAL_ROOT || path.join(process.cwd(), 'repo', `${env.TUTORIAL_LANG || lang}.javascript.info`),
tmpRoot: path.join(process.cwd(), 'tmp', lang),
tutorialRoot: env.TUTORIAL_ROOT || path.join(process.cwd(), 'repo', `${(env.TUTORIAL_LANG || lang).replace(/"/g, '')}.javascript.info`),
tmpRoot: path.join(process.cwd(), 'tmp', lang),
// js/css build versions
cacheRoot: path.join(process.cwd(), 'cache', lang),
assetsRoot: path.join(process.cwd(), 'assets'),
cacheRoot: path.join(process.cwd(), 'cache', lang),
assetsRoot: path.join(process.cwd(), 'assets'),

handlers: require('./handlers')
};
Expand All @@ -71,13 +71,13 @@ let repo = `javascript-tutorial/${config.lang}.javascript.info`;

config.tutorialRepo = {
github: repo,
url: new URL('https://github.com/' + repo),
tree: new URL('https://github.com/' + repo + '/tree/master'),
blob: new URL('https://github.com/' + repo + '/blob/master')
url: new URL('https://github.com/' + repo),
tree: new URL('https://github.com/' + repo + '/tree/master'),
blob: new URL('https://github.com/' + repo + '/blob/master')
};


require.extensions['.yml'] = function(module, filename) {
require.extensions['.yml'] = function (module, filename) {
module.exports = yaml.load(fs.readFileSync(filename, 'utf-8'));
};

Expand All @@ -95,7 +95,7 @@ createRoot(config.publicRoot);
createRoot(config.cacheRoot);
createRoot(config.tmpRoot);

function createRoot(root) {
function createRoot (root) {
// may be existing symlink
if (fs.existsSync(root) && fs.statSync(root).isFile()) {
fs.unlinkSync(root);
Expand Down
2 changes: 2 additions & 0 deletions package.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
"version": "2.0.0",
"private": true,
"scripts": {
"start":"cross-env PORT=8888 ./edit zh",
"en":"cross-env PORT=8888 ./edit en",
"fixperms": "sudo chown -R `id -u` .* * ~/.n*",
"//": "test must exit with status 1 if fails, don't use | or ensure the right exit code if you do",
"test": "cross-env SELENIUM_LOCAL=1 NODE_ENV=test NODE_PATH=./modules ./node_modules/.bin/gulp test",
Expand Down

Back | FazBrowse Home | New Git URL