Skip to content

Instantly share code, notes, and snippets.

@conanak99
Created August 9, 2018 06:00
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save conanak99/296f662942c82480cf8245886c6cad39 to your computer and use it in GitHub Desktop.
const appName = require('./base'); // Dùng module base.js
const { ajax, show } = require('./util'); // Dùng module util.js
async function register(username) {
// Sử dụng hàm ajax và show của module util
await ajax.post('/register', { username });
show(`Welcome ${username} to ${appName}`);
}
// Các module khác có thể dùng hàm register của module này
module.exports = { register };
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment